Skip to content

Commit 1007339

Browse files
HoratiuVulturdavem330
authored andcommitted
net: microchip: vcap: Fix initialization of value and mask
Fix the following smatch warning: smatch warnings: drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:103 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'value'. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:106 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'mask'. In case the vcap field was VCAP_FIELD_U128 and the key was different than IP6_S/DIP then the value and mask were not initialized, therefore initialize them. Fixes: 610c32b ("net: microchip: vcap: Add vcap_get_rule") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Saeed Mahameed <[email protected]> Signed-off-by: Horatiu Vultur <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 98dbec0 commit 1007339

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ static void vcap_debugfs_show_rule_keyfield(struct vcap_control *vctrl,
8383
hex = true;
8484
break;
8585
case VCAP_FIELD_U128:
86+
value = data->u128.value;
87+
mask = data->u128.mask;
8688
if (key == VCAP_KF_L3_IP6_SIP || key == VCAP_KF_L3_IP6_DIP) {
8789
u8 nvalue[16], nmask[16];
8890

0 commit comments

Comments
 (0)