diff mbox series

macsec: Fix invalid error code set

Message ID 20221118011249.48112-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Commit 7cef6b73fba96abef731a53501924fc3c4a0f947
Delegated to: Netdev Maintainers
Headers show
Series macsec: Fix invalid error code set | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 4 this patch: 4
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yue Haibing Nov. 18, 2022, 1:12 a.m. UTC
'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded
case, it will be invalid before return.

Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/macsec.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Saeed Mahameed Nov. 18, 2022, 2:49 a.m. UTC | #1
On 18 Nov 09:12, YueHaibing wrote:
>'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded
>case, it will be invalid before return.
>
>Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
>Signed-off-by: YueHaibing <yuehaibing@huawei.com>

I have the same exact patch lined up in my internal queue.
this needs to go to net: so for next time please tag [PATCH net].

Reviewed-by: Saeed Mahameed <saeed@kernel.org>
Antoine Tenart Nov. 18, 2022, 8:34 a.m. UTC | #2
Quoting YueHaibing (2022-11-18 02:12:49)
> 'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded
> case, it will be invalid before return.
> 
> Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Antoine Tenart <atenart@kernel.org>

Thanks!

> ---
>  drivers/net/macsec.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
> index a7b46219bab7..d73b9d535b7a 100644
> --- a/drivers/net/macsec.c
> +++ b/drivers/net/macsec.c
> @@ -3835,7 +3835,6 @@ static int macsec_changelink(struct net_device *dev, struct nlattr *tb[],
>         if (macsec_is_offloaded(macsec)) {
>                 const struct macsec_ops *ops;
>                 struct macsec_context ctx;
> -               int ret;
>  
>                 ops = macsec_get_ops(netdev_priv(dev), &ctx);
>                 if (!ops) {
> -- 
> 2.20.1
>
patchwork-bot+netdevbpf@kernel.org Nov. 19, 2022, 3:50 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 18 Nov 2022 09:12:49 +0800 you wrote:
> 'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded
> case, it will be invalid before return.
> 
> Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/macsec.c | 1 -
>  1 file changed, 1 deletion(-)

Here is the summary with links:
  - macsec: Fix invalid error code set
    https://git.kernel.org/netdev/net/c/7cef6b73fba9

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index a7b46219bab7..d73b9d535b7a 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -3835,7 +3835,6 @@  static int macsec_changelink(struct net_device *dev, struct nlattr *tb[],
 	if (macsec_is_offloaded(macsec)) {
 		const struct macsec_ops *ops;
 		struct macsec_context ctx;
-		int ret;
 
 		ops = macsec_get_ops(netdev_priv(dev), &ctx);
 		if (!ops) {