linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hippi: incorrect address masking and compare operation
@ 2021-07-02 10:42 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2021-07-02 10:42 UTC (permalink / raw)
  To: Jes Sorensen, Jeff Kirsher, open list:HIPPI
  Cc: David S. Miller, Jakub Kicinski, netdev, linux-kernel

Hi,

Static analysis with Coverity has detected an issue in
drivers/net/hippi/rrunner.c where a masking operation and a comparison
is always false.

The analysis is as follows:

656                /*
657                 * Sanity test to see if we conflict with the DMA
658                 * limitations of the Roadrunner.
659                 */

Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
dead_error_condition: The condition ((unsigned long)skb->data & 0xfffUL)
> 18446744073709486295UL cannot be true.

660                if ((((unsigned long)skb->data) & 0xfff) > ~65320)

Logically dead code (DEADCODE)dead_error_line: Execution cannot reach
this statement: printk("skb alloc error\n");.

661                        printk("skb alloc error\n");
662

I suspect the masking 0xfff is incorrect here, I think it be ~0xfff but
I'm not 100% sure.

Colin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-02 10:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 10:42 hippi: incorrect address masking and compare operation Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).