diff mbox series

[net] net: dpaa: Fix uninitialized variable in dpaa_stop()

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

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter April 20, 2023, 12:36 p.m. UTC
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(-)

Comments

Madalin Bucur (OSS) April 20, 2023, 5:02 p.m. UTC | #1
> -----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!
Sean Anderson April 20, 2023, 8:07 p.m. UTC | #2
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>
patchwork-bot+netdevbpf@kernel.org April 22, 2023, 3:40 a.m. UTC | #3
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 mbox series

Patch

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;