Re: [patch] gpio: potential null dereference

From: Dan Carpenter
Date: Tue Apr 27 2010 - 06:34:37 EST


On Tue, Apr 27, 2010 at 11:41:16AM +0200, Daniel Glöckner wrote:
> It returns a valid pointer iff (desc->flags & GPIO_TRIGGER_MASK).
>
> When !(desc->flags & GPIO_TRIGGER_MASK) it returns NULL and everything
> gets allocated (unless !gpio_flags as well). What you wanted to remove
> is the allocation code, not error handling code.

No no. I don't want to remove anything. I'm happy with the code as is
now that you've explained it to me. :)

regards,
dan carpenter

> It is always run when
> the trigger is set from "none" to something else.
>
> Daniel
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/