[PATCH 1/2] xf86: actually set the compat output in the failure case
Peter Hutterer
peter.hutterer at who-t.net
Thu Jan 10 15:00:12 PST 2013
On Wed, Jan 09, 2013 at 01:14:54PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> The previous fix for the previous fix, didn't fully work,
>
> If we don't set compat_output we end up doing derferences
> of arrays with -1, leading to valgrind warnings.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Cheers,
Peter
> ---
> hw/xfree86/modes/xf86Crtc.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
> index 77a0218..45764fc 100644
> --- a/hw/xfree86/modes/xf86Crtc.c
> +++ b/hw/xfree86/modes/xf86Crtc.c
> @@ -1848,8 +1848,10 @@ SetCompatOutput(xf86CrtcConfigPtr config)
> }
>
> /* All outputs are disconnected, select one to fake */
> - if (!output && config->num_output)
> - output = config->output[0];
> + if (!output && config->num_output) {
> + config->compat_output = 0;
> + output = config->output[config->compat_output];
> + }
>
> return output;
> }
> --
> 1.8.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list