Message ID | 8c9dc377-8495-495f-a4e5-4d2d0ee12f0c@kili.mountain (mailing list archive) |
---|---|
State | Accepted |
Commit | 461bb5b97049a149278f2c27a3aa12af16da6a2e |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: dpaa: Fix uninitialized variable in dpaa_stop() | expand |
> -----Original Message----- > From: Dan Carpenter <dan.carpenter@linaro.org> > Sent: 20 April 2023 15:36 > To: Sean Anderson <sean.anderson@seco.com> > Cc: Madalin Bucur <madalin.bucur@nxp.com>; David S. Miller > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski > <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Camelia Alexandra > Groza <camelia.groza@nxp.com>; netdev@vger.kernel.org; kernel- > janitors@vger.kernel.org > Subject: [PATCH net] net: dpaa: Fix uninitialized variable in dpaa_stop() > > The return value is not initialized on the success path. > > Fixes: 901bdff2f529 ("net: fman: Change return type of disable to void") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > Applies to net. > > drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > index 9318a2554056..f96196617121 100644 > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > @@ -299,7 +299,8 @@ static int dpaa_stop(struct net_device *net_dev) > { > struct mac_device *mac_dev; > struct dpaa_priv *priv; > - int i, err, error; > + int i, error; > + int err = 0; > > priv = netdev_priv(net_dev); > mac_dev = priv->mac_dev; > -- > 2.39.2 Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com> Thank you!
On 4/20/23 13:02, Madalin Bucur (OSS) wrote: >> -----Original Message----- >> From: Dan Carpenter <dan.carpenter@linaro.org> >> Sent: 20 April 2023 15:36 >> To: Sean Anderson <sean.anderson@seco.com> >> Cc: Madalin Bucur <madalin.bucur@nxp.com>; David S. Miller >> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski >> <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Camelia Alexandra >> Groza <camelia.groza@nxp.com>; netdev@vger.kernel.org; kernel- >> janitors@vger.kernel.org >> Subject: [PATCH net] net: dpaa: Fix uninitialized variable in dpaa_stop() >> >> The return value is not initialized on the success path. >> >> Fixes: 901bdff2f529 ("net: fman: Change return type of disable to void") >> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> >> --- >> Applies to net. >> >> drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c >> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c >> index 9318a2554056..f96196617121 100644 >> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c >> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c >> @@ -299,7 +299,8 @@ static int dpaa_stop(struct net_device *net_dev) >> { >> struct mac_device *mac_dev; >> struct dpaa_priv *priv; >> - int i, err, error; >> + int i, error; >> + int err = 0; >> >> priv = netdev_priv(net_dev); >> mac_dev = priv->mac_dev; >> -- >> 2.39.2 > > Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com> > > Thank you! Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Thu, 20 Apr 2023 15:36:07 +0300 you wrote: > The return value is not initialized on the success path. > > Fixes: 901bdff2f529 ("net: fman: Change return type of disable to void") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > Applies to net. > > [...] Here is the summary with links: - [net] net: dpaa: Fix uninitialized variable in dpaa_stop() https://git.kernel.org/netdev/net/c/461bb5b97049 You are awesome, thank you!
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 9318a2554056..f96196617121 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -299,7 +299,8 @@ static int dpaa_stop(struct net_device *net_dev) { struct mac_device *mac_dev; struct dpaa_priv *priv; - int i, err, error; + int i, error; + int err = 0; priv = netdev_priv(net_dev); mac_dev = priv->mac_dev;
The return value is not initialized on the success path. Fixes: 901bdff2f529 ("net: fman: Change return type of disable to void") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- Applies to net. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)