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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230928130555.GJ24230@kernel.org>
Date: Thu, 28 Sep 2023 15:05:55 +0200
From: Simon Horman <horms@...nel.org>
To: liuhaoran <liuhaoran14@....com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH] net: hsr: Add error handling in hsr_portdev_setup()

On Sat, Sep 23, 2023 at 08:24:02PM +0800, liuhaoran wrote:
> This patch adds error-handling for the hsr_port_get_hsr()
> inside the hsr_portdev_setup().
> 
> Signed-off-by: liuhaoran <liuhaoran14@....com>

Please sign off using your real name, which is commonly of the form:

	Signed-off-by: First Last <me@...mple.com>

Please consider targeting this against 'net' as it appears to be a bug fix.

	Subject: [PATCH net] ...

If not, please target the patch against net-next.

If so, please consider using including a fixes tag, immediately
above your Signed-off-by (and any other) tags.

This may be the correct tag, but I'm not completely sure.

Fixes: e0a4b99773d3 ("hsr: use upper/lower device infrastructure")

> ---
>  net/hsr/hsr_slave.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
> index e5742f2a2d52..ac7d6bdef47e 100644
> --- a/net/hsr/hsr_slave.c
> +++ b/net/hsr/hsr_slave.c
> @@ -141,6 +141,10 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev,
>  	}
>  
>  	master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
> +
> +	if (!master)
> +		return -ENODEV;

I think this needs to jump to an unwind label.

		goto fail_upper_dev_link;

But I also think the unwind label should be renamed.
to reflect what they do, rather than where they are called from.

-- 
pw-bot: changes-requested

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ