All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] net: ipa: reduce arguments to ipa_table_init_add()
@ 2022-11-15 13:03 Dan Carpenter
  2022-11-15 17:00 ` Alex Elder
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2022-11-15 13:03 UTC (permalink / raw)
  To: elder; +Cc: kernel-janitors

Hello Alex Elder,

This is a semi-automatic email about new static checker warnings.

The patch 5cb76899fb47: "net: ipa: reduce arguments to 
ipa_table_init_add()" from Nov 2, 2022, leads to the following Smatch 
complaint:

    drivers/net/ipa/ipa_table.c:423 ipa_table_init_add()
    error: we previously assumed 'hash_mem' could be null (see line 414)

drivers/net/ipa/ipa_table.c
   413			count = mem->size / sizeof(__le64);
   414			hash_count = hash_mem && hash_mem->size / sizeof(__le64);
                                     ^^^^^^^^
The patch adds checks for NULL.

   415		}
   416		size = count * sizeof(__le64);
   417		hash_size = hash_count * sizeof(__le64);
   418	
   419		addr = ipa_table_addr(ipa, filter, count);
   420		hash_addr = ipa_table_addr(ipa, filter, hash_count);
   421	
   422		ipa_cmd_table_init_add(trans, opcode, size, mem->offset, addr,
   423				       hash_size, hash_mem->offset, hash_addr);
                                                  ^^^^^^^^^^^^^^^^
Unchecked dereference.

   424		if (!filter)
   425			return;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-19 10:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 13:03 [bug report] net: ipa: reduce arguments to ipa_table_init_add() Dan Carpenter
2022-11-15 17:00 ` Alex Elder
2022-11-17  4:47   ` Dan Carpenter
2022-11-18  9:50     ` Dan Carpenter
2022-11-19  9:21       ` Alex Elder
2022-11-19 10:48         ` Dan Carpenter
2022-11-19  9:04     ` Alex Elder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.