Skip to content

Commit 844436e

Browse files
Dan Carpentersmfrench
authored andcommitted
ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
Unlock before returning an error code if this allocation fails. Fixes: 0626e66 ("cifsd: add server handler for central processing and tranport layers") Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 78c5a6f commit 844436e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/smb/server/transport_tcp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,10 @@ int ksmbd_tcp_set_interfaces(char *ifc_list, int ifc_list_sz)
624624
for_each_netdev(&init_net, netdev) {
625625
if (netif_is_bridge_port(netdev))
626626
continue;
627-
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL)))
627+
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL))) {
628+
rtnl_unlock();
628629
return -ENOMEM;
630+
}
629631
}
630632
rtnl_unlock();
631633
bind_additional_ifaces = 1;

0 commit comments

Comments
 (0)