Skip to content

Commit

Permalink
ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Steve French committed Aug 30, 2024
1 parent 78c5a6f commit 844436e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/smb/server/transport_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 844436e

Please sign in to comment.