From: Wei Liu <wei.liu@kernel.org>
To: Michael Kelley <mikelley@microsoft.com>
Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
Dexuan Cui <decui@microsoft.com>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers: hv: Fix missing error code in vmbus_connect()
Date: Wed, 26 May 2021 10:07:30 +0000 [thread overview]
Message-ID: <20210526100730.fsk3khdqmpbbuljf@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <MWHPR21MB1593D8362CD8FBA6E0E3612CD7259@MWHPR21MB1593.namprd21.prod.outlook.com>
On Tue, May 25, 2021 at 03:30:22PM +0000, Michael Kelley wrote:
> From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Sent: Tuesday, May 25, 2021 3:59 AM
> >
> > Eliminate the follow smatch warning:
> >
> > drivers/hv/connection.c:236 vmbus_connect() warn: missing error code
> > 'ret'.
> >
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> > ---
> > drivers/hv/connection.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> > index 311cd00..5e479d5 100644
> > --- a/drivers/hv/connection.c
> > +++ b/drivers/hv/connection.c
> > @@ -232,8 +232,10 @@ int vmbus_connect(void)
> > */
> >
> > for (i = 0; ; i++) {
> > - if (i == ARRAY_SIZE(vmbus_versions))
> > + if (i == ARRAY_SIZE(vmbus_versions)) {
> > + ret = -EDOM;
> > goto cleanup;
> > + }
> >
> > version = vmbus_versions[i];
> > if (version > max_version)
> > --
> > 1.8.3.1
>
> I might have used -EINVAL instead of -EDOM as the error
> return value, but it really doesn't matter, and having a
> return value that is unique in the function might be helpful.
>
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Applied to hyperv-fixes. Thanks.
prev parent reply other threads:[~2021-05-26 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 10:58 [PATCH] drivers: hv: Fix missing error code in vmbus_connect() Jiapeng Chong
2021-05-25 15:30 ` Michael Kelley
2021-05-26 10:07 ` Wei Liu [this message]
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=20210526100730.fsk3khdqmpbbuljf@liuwe-devbox-debian-v2 \
--to=wei.liu@kernel.org \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=sthemmin@microsoft.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).