From: David Miller <davem@davemloft.net>
To: colin.king@canonical.com
Cc: santosh.shilimkar@oracle.com, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDS: IB: ensure an initialized ret is printed in pr_warn message
Date: Fri, 07 Apr 2017 06:10:12 -0700 (PDT) [thread overview]
Message-ID: <20170407.061012.962256066660810702.davem@davemloft.net> (raw)
In-Reply-To: <20170407075723.9669-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Fri, 7 Apr 2017 08:57:23 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> There is a path where ibmr is null and ret has not been initialized
> and hence a pr_warn message is printing an uninitialized value in
> ret. Fix this by initializing ret to zero.
>
> Detected by CoverityScan, CID#1357946 ("Uninitialized scalar variable")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
These are exactly the kinds of CoverityScan fixes I really do not want
to see.
Initializing ret to zero is not going to fix the problem.
This function gets error pointers back from the functions that are
used to obtain the ibmr pointer. Therefore if there is a problem
ibmr won't be NULL, it will be an error pointer.
Therefore, the real problem is that the code isn't checking if
ibmr encodes error value.
next prev parent reply other threads:[~2017-04-07 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-07 7:57 [PATCH] RDS: IB: ensure an initialized ret is printed in pr_warn message Colin King
2017-04-07 13:10 ` David Miller [this message]
2017-04-07 14:24 ` Dan Carpenter
2017-04-07 15:59 ` Santosh Shilimkar
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=20170407.061012.962256066660810702.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.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;
as well as URLs for NNTP newsgroup(s).