From: "Saleem, Shiraz" <shiraz.saleem@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
"Ismail, Mustafa" <mustafa.ismail@intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH] RDMA/irdma: prevent some integer underflows
Date: Tue, 8 Mar 2022 16:45:21 +0000 [thread overview]
Message-ID: <ef3d0d8dfbc54f3fa4addda8e131c909@intel.com> (raw)
In-Reply-To: <20220307125928.GE16710@kili>
> Subject: [PATCH] RDMA/irdma: prevent some integer underflows
>
> My static checker complains that:
>
> drivers/infiniband/hw/irdma/ctrl.c:3605 irdma_sc_ceq_init()
> warn: can subtract underflow 'info->dev->hmc_fpm_misc.max_ceqs'?
>
> It appears that "info->dev->hmc_fpm_misc.max_ceqs" comes from the firmware
> in irdma_sc_parse_fpm_query_buf() so, yes, there is a chance that it could be
> zero. Even if we trust the firmware, it's easy enough to change the condition just
> as a hardenning measure.
>
> Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/infiniband/hw/irdma/ctrl.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
Seems reasonable.
Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
next prev parent reply other threads:[~2022-03-08 16:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 12:59 [PATCH] RDMA/irdma: prevent some integer underflows Dan Carpenter
2022-03-08 16:45 ` Saleem, Shiraz [this message]
2022-03-14 23:44 ` Jason Gunthorpe
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=ef3d0d8dfbc54f3fa4addda8e131c909@intel.com \
--to=shiraz.saleem@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
/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