Re: Linux 2.1.72 - a few oddities.

Brian M Grunkemeyer (bg2k@CMU.EDU)
Tue, 9 Dec 1997 22:35:44 -0500 (EST)


Excerpts from internet.computing.linux-kernel: 10-Dec-97 Linux 2.1.72 -
a few oddities. by David Woodhouse@cam.ac.u
> - /* Free device too !! - AC FIXME: CHECK THIS IS RIGHT */
> - if (devc)
> + if (!devc)
> vfree(devc);

Doesn't this now only vfree devc if it is 0, as opposed to freeing it if
it is allocated? Looks like you introduced a memory leak. If you
really want to be picky, try:

if (NULL != devc)

Technically this is the most correct plus if you always use this order
in testing and you accidentally use = instead of ==, the compiler
catches the bug since you tried to assign to a constant value (at least
when testing against NULL).