mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
commit 844436e045ac2ab7895d8b281cb784a24de1d14d upstream.
Unlock before returning an error code if this allocation fails.
Fixes: 0626e6641f ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
93d54a4b59
commit
eaebe313e8
@@ -622,8 +622,10 @@ int ksmbd_tcp_set_interfaces(char *ifc_list, int ifc_list_sz)
|
|||||||
for_each_netdev(&init_net, netdev) {
|
for_each_netdev(&init_net, netdev) {
|
||||||
if (netif_is_bridge_port(netdev))
|
if (netif_is_bridge_port(netdev))
|
||||||
continue;
|
continue;
|
||||||
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL)))
|
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL))) {
|
||||||
|
rtnl_unlock();
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
bind_additional_ifaces = 1;
|
bind_additional_ifaces = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user