[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<AS4PR05MB96474C1DE6EF37FE501AD72D884D2@AS4PR05MB9647.eurprd05.prod.outlook.com>
Date: Thu, 15 Feb 2024 01:06:36 +0000
From: Tung Quang Nguyen <tung.q.nguyen@...tech.com.au>
To: Shigeru Yoshida <syoshida@...hat.com>, "jmaloy@...hat.com"
<jmaloy@...hat.com>, "ying.xue@...driver.com" <ying.xue@...driver.com>,
"davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
<edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"tipc-discussion@...ts.sourceforge.net"
<tipc-discussion@...ts.sourceforge.net>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] tipc: Cleanup tipc_nl_bearer_add() error paths
> net/tipc/bearer.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
>diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 878415c43527..5a526ebafeb4 100644
>--- a/net/tipc/bearer.c
>+++ b/net/tipc/bearer.c
>@@ -1079,30 +1079,27 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info)
> rtnl_lock();
> b = tipc_bearer_find(net, name);
> if (!b) {
>- rtnl_unlock();
> NL_SET_ERR_MSG(info->extack, "Bearer not found");
>- return -EINVAL;
>+ err = -EINVAL;
>+ goto out;
> }
>
> #ifdef CONFIG_TIPC_MEDIA_UDP
> if (attrs[TIPC_NLA_BEARER_UDP_OPTS]) {
> if (b->media->type_id != TIPC_MEDIA_TYPE_UDP) {
>- rtnl_unlock();
> NL_SET_ERR_MSG(info->extack, "UDP option is unsupported");
>- return -EINVAL;
>+ err = -EINVAL;
>+ goto out;
> }
>
> err = tipc_udp_nl_bearer_add(b,
> attrs[TIPC_NLA_BEARER_UDP_OPTS]);
>- if (err) {
>- rtnl_unlock();
>- return err;
>- }
> }
> #endif
>+out:
> rtnl_unlock();
>
>- return 0;
>+ return err;
> }
>
> int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
>--
>2.43.0
>
Reviewed-by: Tung Nguyen <tung.q.nguyen@...tech.com.au>
Powered by blists - more mailing lists