* [PATCH] vxge: ensure data0 is initialized in when fetching firmware version information
@ 2018-12-18 15:19 Colin King
2018-12-19 6:03 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-12-18 15:19 UTC (permalink / raw)
To: Jon Mason, David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently variable data0 is not being initialized so a garbage value is
being passed to vxge_hw_vpath_fw_api and this value is being written to
the rts_access_steer_data0 register. There are other occurrances where
data0 is being initialized to zero (e.g. in function
vxge_hw_upgrade_read_version) so I think it makes sense to ensure data0
is initialized likewise to 0.
Detected by CoverityScan, CID#140696 ("Uninitialized scalar variable")
Fixes: 8424e00dfd52 ("vxge: serialize access to steering control register")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/neterion/vxge/vxge-config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index 4c1fb7e57888..7cde387e5ec6 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
@@ -808,7 +808,7 @@ __vxge_hw_vpath_fw_ver_get(struct __vxge_hw_virtualpath *vpath,
struct vxge_hw_device_date *fw_date = &hw_info->fw_date;
struct vxge_hw_device_version *flash_version = &hw_info->flash_version;
struct vxge_hw_device_date *flash_date = &hw_info->flash_date;
- u64 data0, data1 = 0, steer_ctrl = 0;
+ u64 data0 = 0, data1 = 0, steer_ctrl = 0;
enum vxge_hw_status status;
status = vxge_hw_vpath_fw_api(vpath,
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vxge: ensure data0 is initialized in when fetching firmware version information
2018-12-18 15:19 [PATCH] vxge: ensure data0 is initialized in when fetching firmware version information Colin King
@ 2018-12-19 6:03 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-19 6:03 UTC (permalink / raw)
To: colin.king; +Cc: jdmason, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Tue, 18 Dec 2018 15:19:47 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently variable data0 is not being initialized so a garbage value is
> being passed to vxge_hw_vpath_fw_api and this value is being written to
> the rts_access_steer_data0 register. There are other occurrances where
> data0 is being initialized to zero (e.g. in function
> vxge_hw_upgrade_read_version) so I think it makes sense to ensure data0
> is initialized likewise to 0.
>
> Detected by CoverityScan, CID#140696 ("Uninitialized scalar variable")
>
> Fixes: 8424e00dfd52 ("vxge: serialize access to steering control register")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-19 6:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 15:19 [PATCH] vxge: ensure data0 is initialized in when fetching firmware version information Colin King
2018-12-19 6:03 ` David Miller
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).