[lkml]   [2005]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Do not misuse Coverity please (Was: sound/oss/cs46xx.c: fix a check after use)
On Mar 29, 2005, at 09:22, Daniel Jacobowitz wrote:
> The thing GCC is most likely to do with this code is discard the NULL
> check entirely and leave only the oops; the "if (!card)" can not be
> reached without passing through "card->amplifier", and a pointer which
> is dereferenced can not be NULL in a valid program.

Not true! It is perfectly legal on a large number of platforms to
explicitly mmap something at the address 0, at which point dereferencing
a null pointer is exactly like dereferencing any other pointer on the
heap. Doing so is not recommended except in a few special cases for
emulators and such, but it works to some extent.

Kyle Moffett

Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-04-06 13:31    [W:0.094 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site