Thread (2 messages) 2 messages, 2 authors, 2011-02-13

arch/powerpc/kernel/cacheinfo.c: Possible null pointer dereference

flat view

From: David Binderman <hidden>
Date: 2011-02-12 10:13:49

Hello there,

I just tried out cppcheck-1.47 on the linux-2.6.38-rc4 source code.

It said

[arch/powerpc/kernel/cacheinfo.c:380]: (error) Possible null pointer dereference: cache - otherwise it is redundant to check if cache is null at line 382

The source code is

    WARN_ONCE(cache && cache->level != level,
          "cache level mismatch on lookup (got %d, expected %d)\n",
          cache->level, level);

    if (!cache)

I agree with cppcheck. Suggest code rework.

Regards

David Binderman

 		 	   		  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help