From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <dan.carpenter@linaro.org>
Cc: <cong.wang@bytedance.com>, <davem@davemloft.net>,
<edumazet@google.com>, <horms@kernel.org>, <idosch@nvidia.com>,
<kernel-janitors@vger.kernel.org>, <kuba@kernel.org>,
<kuniyu@amazon.com>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>
Subject: Re: [PATCH net-next] rtnetlink: fix error code in rtnl_newlink()
Date: Sat, 7 Dec 2024 08:27:31 +0900 [thread overview]
Message-ID: <20241206232731.38026-1-kuniyu@amazon.com> (raw)
In-Reply-To: <a2d20cd4-387a-4475-887c-bb7d0e88e25a@stanley.mountain>
> [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@linaro.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.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
next prev parent reply other threads:[~2024-12-06 23:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 12:32 [PATCH net-next] rtnetlink: fix error code in rtnl_newlink() Dan Carpenter
2024-12-06 23:27 ` Kuniyuki Iwashima [this message]
2024-12-07 17:07 ` Dan Carpenter
2024-12-08 2:30 ` patchwork-bot+netdevbpf
2024-12-10 5:58 ` Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241206232731.38026-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=cong.wang@bytedance.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox