* [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask
@ 2022-12-19 8:22 Horatiu Vultur
2022-12-19 12:20 ` Michal Swiatkowski
2022-12-19 12:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Horatiu Vultur @ 2022-12-19 8:22 UTC (permalink / raw)
To: linux-arm-kernel, netdev, linux-kernel
Cc: davem, edumazet, kuba, pabeni, lars.povlsen, Steen.Hegelund,
daniel.machon, UNGLinuxDriver, Horatiu Vultur, kernel test robot,
Dan Carpenter, Saeed Mahameed
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: 610c32b2ce66 ("net: microchip: vcap: Add vcap_get_rule")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Saeed Mahameed <saeed@kernel.org>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
v1->v2:
- rebase on net
- both the mask and value were assigned to data->u128.value, which is
wrong, fix this.
---
drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
index 895bfff550d23..e0b206247f2eb 100644
--- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
+++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
@@ -83,6 +83,8 @@ static void vcap_debugfs_show_rule_keyfield(struct vcap_control *vctrl,
hex = true;
break;
case VCAP_FIELD_U128:
+ value = data->u128.value;
+ mask = data->u128.mask;
if (key == VCAP_KF_L3_IP6_SIP || key == VCAP_KF_L3_IP6_DIP) {
u8 nvalue[16], nmask[16];
--
2.38.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask
2022-12-19 8:22 [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask Horatiu Vultur
@ 2022-12-19 12:20 ` Michal Swiatkowski
2022-12-19 12:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Michal Swiatkowski @ 2022-12-19 12:20 UTC (permalink / raw)
To: Horatiu Vultur
Cc: linux-arm-kernel, netdev, linux-kernel, davem, edumazet, kuba,
pabeni, lars.povlsen, Steen.Hegelund, daniel.machon,
UNGLinuxDriver, kernel test robot, Dan Carpenter, Saeed Mahameed
On Mon, Dec 19, 2022 at 09:22:15AM +0100, Horatiu Vultur wrote:
> 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: 610c32b2ce66 ("net: microchip: vcap: Add vcap_get_rule")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Reviewed-by: Saeed Mahameed <saeed@kernel.org>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> v1->v2:
> - rebase on net
> - both the mask and value were assigned to data->u128.value, which is
> wrong, fix this.
> ---
> drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
> index 895bfff550d23..e0b206247f2eb 100644
> --- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
> +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
> @@ -83,6 +83,8 @@ static void vcap_debugfs_show_rule_keyfield(struct vcap_control *vctrl,
> hex = true;
> break;
> case VCAP_FIELD_U128:
> + value = data->u128.value;
> + mask = data->u128.mask;
> if (key == VCAP_KF_L3_IP6_SIP || key == VCAP_KF_L3_IP6_DIP) {
> u8 nvalue[16], nmask[16];
>
> --
> 2.38.0
Looks fine
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask
2022-12-19 8:22 [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask Horatiu Vultur
2022-12-19 12:20 ` Michal Swiatkowski
@ 2022-12-19 12:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-19 12:30 UTC (permalink / raw)
To: Horatiu Vultur
Cc: linux-arm-kernel, netdev, linux-kernel, davem, edumazet, kuba,
pabeni, lars.povlsen, Steen.Hegelund, daniel.machon,
UNGLinuxDriver, lkp, error27, saeed
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Mon, 19 Dec 2022 09:22:15 +0100 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net,v2] net: microchip: vcap: Fix initialization of value and mask
https://git.kernel.org/netdev/net/c/10073399cb5e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-19 12:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-19 8:22 [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask Horatiu Vultur
2022-12-19 12:20 ` Michal Swiatkowski
2022-12-19 12:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox