From: Dan Carpenter <error27@gmail.com>
To: elder@linaro.org
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] net: ipa: reduce arguments to ipa_table_init_add()
Date: Tue, 15 Nov 2022 16:03:59 +0300 [thread overview]
Message-ID: <Y3OOP9dXK6oEydkf@kili> (raw)
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
next reply other threads:[~2022-11-15 13:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 13:03 Dan Carpenter [this message]
2022-11-15 17:00 ` [bug report] net: ipa: reduce arguments to ipa_table_init_add() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3OOP9dXK6oEydkf@kili \
--to=error27@gmail.com \
--cc=elder@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).