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: <20210206112002.4d08516d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Sat, 6 Feb 2021 11:20:02 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Zheng Yongjun <zhengyongjun3@...wei.com>
Cc:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: core: Return the correct errno code

On Thu, 4 Feb 2021 11:19:23 +0800 Zheng Yongjun wrote:
> When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
> ---
>  net/core/rtnetlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 7d7223691783..6df8fb25668b 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -177,7 +177,7 @@ static int rtnl_register_internal(struct module *owner,
>  	struct rtnl_link *link, *old;
>  	struct rtnl_link __rcu **tab;
>  	int msgindex;
> -	int ret = -ENOBUFS;
> +	int ret = -ENOMEM;

while at it please move the line above int msgindex; so that variable
lines are sorted longest to shortest.

>  	BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
>  	msgindex = rtm_msgindex(msgtype);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ