* [PATCH net v2] qed: Fix uninitialized data in aRFS infrastructure
@ 2017-05-14 9:21 Yuval Mintz
2017-05-15 14:35 ` Arnd Bergmann
2017-05-15 18:39 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Yuval Mintz @ 2017-05-14 9:21 UTC (permalink / raw)
To: arnd, davem, netdev; +Cc: Yuval Mintz
Current memset is using incorrect type of variable, causing the
upper-half of the strucutre to be left uninitialized and causing:
ethernet/qlogic/qed/qed_init_fw_funcs.c: In function 'qed_set_rfs_mode_disable':
ethernet/qlogic/qed/qed_init_fw_funcs.c:993:3: error: '*((void *)&ramline+4)' is used uninitialized in this function [-Werror=uninitialized]
Fixes: d51e4af5c209 ("qed: aRFS infrastructure support")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
Hi Arnd,
I don't see the original warning you've reported [probably due to
compiler differences], so other than via code reading I couldn't
actually test this. Can you please compile-test this one?
As mentioned in the original thread, I'll send the style-change
later to net-next.
Dave - please consider applying this to `net'.
Thanks,
Yuval
---
drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c b/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
index 67200c5..0a8fde6 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
@@ -983,7 +983,7 @@ void qed_set_rfs_mode_disable(struct qed_hwfn *p_hwfn,
memset(&camline, 0, sizeof(union gft_cam_line_union));
qed_wr(p_hwfn, p_ptt, PRS_REG_GFT_CAM + CAM_LINE_SIZE * pf_id,
camline.cam_line_mapped.camline);
- memset(&ramline, 0, sizeof(union gft_cam_line_union));
+ memset(&ramline, 0, sizeof(ramline));
for (i = 0; i < RAM_LINE_SIZE / REG_SIZE; i++) {
u32 hw_addr = PRS_REG_GFT_PROFILE_MASK_RAM;
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] qed: Fix uninitialized data in aRFS infrastructure
2017-05-14 9:21 [PATCH net v2] qed: Fix uninitialized data in aRFS infrastructure Yuval Mintz
@ 2017-05-15 14:35 ` Arnd Bergmann
2017-05-15 18:39 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-05-15 14:35 UTC (permalink / raw)
To: Yuval Mintz; +Cc: David Miller, Networking
On Sun, May 14, 2017 at 11:21 AM, Yuval Mintz <Yuval.Mintz@cavium.com> wrote:
> Current memset is using incorrect type of variable, causing the
> upper-half of the strucutre to be left uninitialized and causing:
>
> ethernet/qlogic/qed/qed_init_fw_funcs.c: In function 'qed_set_rfs_mode_disable':
> ethernet/qlogic/qed/qed_init_fw_funcs.c:993:3: error: '*((void *)&ramline+4)' is used uninitialized in this function [-Werror=uninitialized]
>
> Fixes: d51e4af5c209 ("qed: aRFS infrastructure support")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
> I don't see the original warning you've reported [probably due to
> compiler differences], so other than via code reading I couldn't
> actually test this. Can you please compile-test this one?
I don't see the warning any more either with the compiler and defconfig
I used last time, maybe some compiler flags have changed in the
meantime.
Anyway, your patch is definitely required to make it work correctly, so
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] qed: Fix uninitialized data in aRFS infrastructure
2017-05-14 9:21 [PATCH net v2] qed: Fix uninitialized data in aRFS infrastructure Yuval Mintz
2017-05-15 14:35 ` Arnd Bergmann
@ 2017-05-15 18:39 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-05-15 18:39 UTC (permalink / raw)
To: Yuval.Mintz; +Cc: arnd, netdev
From: Yuval Mintz <Yuval.Mintz@cavium.com>
Date: Sun, 14 May 2017 12:21:23 +0300
> Current memset is using incorrect type of variable, causing the
> upper-half of the strucutre to be left uninitialized and causing:
>
> ethernet/qlogic/qed/qed_init_fw_funcs.c: In function 'qed_set_rfs_mode_disable':
> ethernet/qlogic/qed/qed_init_fw_funcs.c:993:3: error: '*((void *)&ramline+4)' is used uninitialized in this function [-Werror=uninitialized]
>
> Fixes: d51e4af5c209 ("qed: aRFS infrastructure support")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-15 18:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-14 9:21 [PATCH net v2] qed: Fix uninitialized data in aRFS infrastructure Yuval Mintz
2017-05-15 14:35 ` Arnd Bergmann
2017-05-15 18:39 ` 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).