]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/socket.c
[ARM] 4902/1: [AT91] SAM9/CAP9 memory controller header
[linux-2.6-omap-h63xx.git] / net / socket.c
index 7651de0085028dc4d02b15e5844e239dd938d01e..9d3fbfbc8535c8b3f2e0639990098730ba4ecbc7 100644 (file)
@@ -701,6 +701,9 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
 {
        struct socket *sock = file->private_data;
 
+       if (unlikely(!sock->ops->splice_read))
+               return -EINVAL;
+
        return sock->ops->splice_read(sock, ppos, pipe, len, flags);
 }
 
@@ -906,11 +909,10 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
                        if (!dlci_ioctl_hook)
                                request_module("dlci");
 
-                       if (dlci_ioctl_hook) {
-                               mutex_lock(&dlci_ioctl_mutex);
+                       mutex_lock(&dlci_ioctl_mutex);
+                       if (dlci_ioctl_hook)
                                err = dlci_ioctl_hook(cmd, argp);
-                               mutex_unlock(&dlci_ioctl_mutex);
-                       }
+                       mutex_unlock(&dlci_ioctl_mutex);
                        break;
                default:
                        err = sock->ops->ioctl(sock, cmd, arg);