aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-03-21 18:58:52 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-21 18:58:52 -0400
commit7512cbf6efc97644812f137527a54b8e92b6a90a (patch)
treebf603e7ede2af1163c866bc04e540807d1a298c1 /net
parent1233823b0847190976d69a86d7bb1287992ba2c7 (diff)
[DLCI]: Fix tiny race between module unload and sock_ioctl.
This is a narrow pedantry :) but the dlci_ioctl_hook check and call should not be parted with the mutex lock. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/socket.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/socket.c b/net/socket.c
index b6d35cd72a50..9d3fbfbc8535 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -909,11 +909,10 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
909 if (!dlci_ioctl_hook) 909 if (!dlci_ioctl_hook)
910 request_module("dlci"); 910 request_module("dlci");
911 911
912 if (dlci_ioctl_hook) { 912 mutex_lock(&dlci_ioctl_mutex);
913 mutex_lock(&dlci_ioctl_mutex); 913 if (dlci_ioctl_hook)
914 err = dlci_ioctl_hook(cmd, argp); 914 err = dlci_ioctl_hook(cmd, argp);
915 mutex_unlock(&dlci_ioctl_mutex); 915 mutex_unlock(&dlci_ioctl_mutex);
916 }
917 break; 916 break;
918 default: 917 default:
919 err = sock->ops->ioctl(sock, cmd, arg); 918 err = sock->ops->ioctl(sock, cmd, arg);