Skip to content

Commit

Permalink
vxge: ensure data0 is initialized in when fetching firmware version i…
Browse files Browse the repository at this point in the history
…nformation

[ Upstream commit f7db2beb4c2c6cc8111f5ab90fc7363ca91107b6 ]

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: 8424e00 ("vxge: serialize access to steering control register")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Colin Ian King authored and gregkh committed Jan 13, 2019
1 parent 945b416 commit 098143b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/neterion/vxge/vxge-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,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,
Expand Down

0 comments on commit 098143b

Please sign in to comment.