[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206232731.38026-1-kuniyu@amazon.com>
Date: Sat, 7 Dec 2024 08:27:31 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <dan.carpenter@...aro.org>
CC: <cong.wang@...edance.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
<horms@...nel.org>, <idosch@...dia.com>, <kernel-janitors@...r.kernel.org>,
<kuba@...nel.org>, <kuniyu@...zon.com>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH net-next] rtnetlink: fix error code in rtnl_newlink()
> [PATCH net-next] rtnetlink: fix error code in rtnl_newlink()
This should be tagged for net.git.
Otherwise looks good to me.
> If rtnl_get_peer_net() fails, then propagate the error code. Don't
> return success.
>
> Fixes: 48327566769a ("rtnetlink: fix double call of rtnl_link_get_net_ifla()")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@...zon.com>
Thanks!
> ---
> net/core/rtnetlink.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index ab5f201bf0ab..ebcfc2debf1a 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -3972,8 +3972,10 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
>
> if (ops->peer_type) {
> peer_net = rtnl_get_peer_net(ops, data, extack);
> - if (IS_ERR(peer_net))
> + if (IS_ERR(peer_net)) {
> + ret = PTR_ERR(peer_net);
> goto put_ops;
> + }
> if (peer_net)
> rtnl_nets_add(&rtnl_nets, peer_net);
> }
> --
> 2.45.2
Powered by blists - more mailing lists