lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 27 Oct 2023 15:36:16 +0200
From: Wojciech Drewek <wojciech.drewek@...el.com>
To: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>, <rajur@...lsio.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH] cxgb4: Fix missing error code in
 cxgb4_port_mirror_alloc()



On 27.10.2023 06:00, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'ret'.
> 
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:1525 cxgb4_port_mirror_alloc() warn: missing error code 'ret'.
> 
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7063
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---
>  drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> index 2eb33a727bba..e59e199184f4 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> @@ -1522,6 +1522,7 @@ int cxgb4_port_mirror_alloc(struct net_device *dev)
>  	mutex_lock(&pi->vi_mirror_mutex);
>  	if (pi->viid_mirror) {
>  		pi->vi_mirror_count++;
> +		ret = -EINVAL;

I'm not sure we should return error here. This looks like we're adding a new subscriber to
the mirror action so the function should return 0 (ret is initialized to 0). viid_mirror exists,
we're just incrementing the count of its users.

>  		goto out_unlock;
>  	}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ