Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1609161
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] netvsc: fix unititialized return value in variable ret |
| Date | 2017-03-25 15:20 +0100 |
| Message-ID | <toUHT-1Wx-9@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] netvsc: fix unititialized return value in variable ret Colin King <colin.king@canonical.com> - 2017-03-25 15:20 +0100 RE: [PATCH] netvsc: fix unititialized return value in variable ret Haiyang Zhang <haiyangz@microsoft.com> - 2017-03-27 03:00 +0200
csiph-web