Thread (3 messages) flat view 3 messages, 3 authors, 2021-03-03

Re: [PATCH] ibmvnic: Fix possibly uninitialized old_num_tx_queues variable warning.

From: Sukadev Bhattiprolu <hidden>
Date: 2021-03-02 22:55:05
Also in: linuxppc-dev, lkml

Michal Suchanek [msuchanek@suse.de] wrote:
GCC 7.5 reports:
../drivers/net/ethernet/ibm/ibmvnic.c: In function 'ibmvnic_reset_init':
../drivers/net/ethernet/ibm/ibmvnic.c:5373:51: warning: 'old_num_tx_queues' may be used uninitialized in this function [-Wmaybe-uninitialized]
../drivers/net/ethernet/ibm/ibmvnic.c:5373:6: warning: 'old_num_rx_queues' may be used uninitialized in this function [-Wmaybe-uninitialized]

The variable is initialized only if(reset) and used only if(reset &&
something) so this is a false positive. However, there is no reason to
not initialize the variables unconditionally avoiding the warning.
Yeah, its a false positive, but initializing doesn't hurt.
Fixes: 635e442f4a48 ("ibmvnic: merge ibmvnic_reset_init and ibmvnic_init")
Signed-off-by: Michal Suchanek <redacted>
Reviewed-by: Sukadev Bhattiprolu <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help