* [PATCH] ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
@ 2024-08-29 19:22 Dan Carpenter
2024-08-30 0:23 ` Namjae Jeon
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-08-29 19:22 UTC (permalink / raw)
To: Namjae Jeon
Cc: Namjae Jeon, Steve French, Sergey Senozhatsky, Tom Talpey,
Hyunchul Lee, Ronnie Sahlberg, linux-cifs, linux-kernel,
kernel-janitors
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@linaro.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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
2024-08-29 19:22 [PATCH] ksmbd: Unlock on in ksmbd_tcp_set_interfaces() Dan Carpenter
@ 2024-08-30 0:23 ` Namjae Jeon
0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2024-08-30 0:23 UTC (permalink / raw)
To: Dan Carpenter
Cc: Namjae Jeon, Steve French, Sergey Senozhatsky, Tom Talpey,
Hyunchul Lee, Ronnie Sahlberg, linux-cifs, linux-kernel,
kernel-janitors
On Fri, Aug 30, 2024 at 4:22 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> 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@linaro.org>
Looks good to me.
Applied it to #ksmbd-for-next-next.
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-30 0:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-29 19:22 [PATCH] ksmbd: Unlock on in ksmbd_tcp_set_interfaces() Dan Carpenter
2024-08-30 0:23 ` Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®