From: Colin King <colin.king@canonical.com>
To: "K . Y . Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
devel@linuxdriverproject.org, netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] netvsc: fix unititialized return value in variable ret
Date: Sat, 25 Mar 2017 14:16:53 +0000 [thread overview]
Message-ID: <20170325141653.11238-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
It is possible for an uninitialized value of ret to be returned
so fix this by initializing ret to zero.
Detected by CoverityScan, CID#1420762 ("Uninitialized scalar variable")
Fixes: 163891d7d429 ("netvsc: handle offline mtu and channel change")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/hyperv/netvsc_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index eb7ae79d47bb..f830bbbd8ad4 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -855,7 +855,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
struct hv_device *hdev = ndevctx->device_ctx;
struct netvsc_device_info device_info;
bool was_running;
- int ret;
+ int ret = 0;
if (!nvdev || nvdev->destroy)
return -ENODEV;
--
2.11.0
next reply other threads:[~2017-03-25 14:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 14:16 Colin King [this message]
2017-03-27 0:52 ` [PATCH] netvsc: fix unititialized return value in variable ret Haiyang Zhang
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=20170325141653.11238-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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).