Message ID | 20221009070912.55353-1-mengyuanlou@net-swift.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: ngbe: Variables need to be initialized | expand |
On Sun, 9 Oct 2022 15:09:12 +0800 Mengyuan Lou wrote: > Variables need to be initialized in ngbe_shutdown() > Fix: commit <e79e40c83b9f> ("net: ngbe: Add build support for ngbe") Please look at the git history to find out what the correct form is for the Fixes tag. > Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> > --- > drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c > index 7674cb6e5700..f754e53eb852 100644 > --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c > +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c > @@ -46,7 +46,7 @@ static void ngbe_dev_shutdown(struct pci_dev *pdev, bool *enable_wake) > > static void ngbe_shutdown(struct pci_dev *pdev) > { > - bool wake; > + bool wake = false; > > ngbe_dev_shutdown(pdev, &wake); The callee should make sure to always write to the variable, caller init is a worse fix.
diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c index 7674cb6e5700..f754e53eb852 100644 --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c @@ -46,7 +46,7 @@ static void ngbe_dev_shutdown(struct pci_dev *pdev, bool *enable_wake) static void ngbe_shutdown(struct pci_dev *pdev) { - bool wake; + bool wake = false; ngbe_dev_shutdown(pdev, &wake);
Variables need to be initialized in ngbe_shutdown() Fix: commit <e79e40c83b9f> ("net: ngbe: Add build support for ngbe") Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> --- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)