[PATCH 06/12] kdrive: fix dereference before null check.

Alan Coopersmith alan.coopersmith at oracle.com
Thu Oct 20 07:21:12 PDT 2011


On 10/20/11 03:44, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> pointed out by coverity scan.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   hw/kdrive/linux/evdev.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
> index 3797f09..c8fc5bc 100644
> --- a/hw/kdrive/linux/evdev.c
> +++ b/hw/kdrive/linux/evdev.c
> @@ -331,11 +331,11 @@ EvdevPtrDisable (KdPointerInfo *pi)
>   {
>       Kevdev              *ke;
>
> -    ke = pi->driverPrivate;
> -
>       if (!pi || !pi->driverPrivate)
>           return;
>
> +    ke = pi->driverPrivate;
> +
>       KdUnregisterFd (pi, ke->fd, TRUE);
>
>       if (ioctl (ke->fd, EVIOCGRAB, 0)<  0)

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list