[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <89c440a9-27bd-45d9-9d5b-5b4bf51ec950@stanley.mountain>
Date: Thu, 29 Aug 2024 22:22:35 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Namjae Jeon <namjae.jeon@...sung.com>
Cc: Namjae Jeon <linkinjeon@...nel.org>, Steve French <sfrench@...ba.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Tom Talpey <tom@...pey.com>, Hyunchul Lee <hyc.lee@...il.com>,
Ronnie Sahlberg <lsahlber@...hat.com>, linux-cifs@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
Unlock before returning an error code if this allocation fails.
Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
fs/smb/server/transport_tcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c
index a84788396daa..aaed9e293b2e 100644
--- a/fs/smb/server/transport_tcp.c
+++ b/fs/smb/server/transport_tcp.c
@@ -624,8 +624,10 @@ int ksmbd_tcp_set_interfaces(char *ifc_list, int ifc_list_sz)
for_each_netdev(&init_net, netdev) {
if (netif_is_bridge_port(netdev))
continue;
- if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL)))
+ if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL))) {
+ rtnl_unlock();
return -ENOMEM;
+ }
}
rtnl_unlock();
bind_additional_ifaces = 1;
--
2.45.2
Powered by blists - more mailing lists