]> err.no Git - linux-2.6/blobdiff - drivers/block/nbd.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
[linux-2.6] / drivers / block / nbd.c
index b53fdb0a282c4858590993bb790a003f3b436372..60cc54368b66eaa1c7888ab905f7c9b83c92bd41 100644 (file)
@@ -153,6 +153,12 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size,
        struct kvec iov;
        sigset_t blocked, oldset;
 
+       if (unlikely(!sock)) {
+               printk(KERN_ERR "%s: Attempted %s on closed socket in sock_xmit\n",
+                      lo->disk->disk_name, (send ? "send" : "recv"));
+               return -EINVAL;
+       }
+
        /* Allow interception of SIGKILL only
         * Don't allow other signals to interrupt the transmission */
        siginitsetinv(&blocked, sigmask(SIGKILL));