Re: [Patch] Possible NULL pointer dereference in fs/configfs/dir.c

From: Joel Becker
Date: Wed Mar 22 2006 - 18:54:36 EST


On Thu, Mar 23, 2006 at 12:36:54AM +0100, Eric Sesterhenn wrote:
> I would then propose the following patch, so the check can be
> removed for people who like small kernels. I dont think gcc notices
> that all callers use non-NULL values and optimizes it away.
>
> - if (group && group->default_groups) {
> + BUG_ON(!group); /* group == NULL is not allowed */
> +
> + if (group->default_groups) {

This is pretty much what I meant. Thanks.

Joel
--

Life's Little Instruction Book #3

"Watch a sunrise at least once a year."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@xxxxxxxxxx
Phone: (650) 506-8127
-
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/