]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Nov 2016 00:42:03 +0000 (16:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Nov 2016 00:42:03 +0000 (16:42 -0800)
Pull block fixes from Jens Axboe:
 "Two small (really, one liners both of them!) fixes that should go into
  this series:

   - Request allocation error handling fix for nbd, from Christophe,
     fixing a regression in this series.

   - An oops fix for drbd. Not a regression in this series, but stable
     material. From Richard"

* 'for-linus' of git://git.kernel.dk/linux-block:
  drbd: Fix kernel_sendmsg() usage - potential NULL deref
  nbd: Fix error handling

drivers/block/drbd/drbd_main.c
drivers/block/nbd.c

index 100be556e6137ce1e5731fd68eec5b317ed3bcc8..83482721bc012739cf25ee627fd2b85b2fd094ab 100644 (file)
@@ -1871,7 +1871,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
                drbd_update_congested(connection);
        }
        do {
-               rv = kernel_sendmsg(sock, &msg, &iov, 1, size);
+               rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);
                if (rv == -EAGAIN) {
                        if (we_should_drop_the_connection(connection, sock))
                                break;
index 19a16b2dbb917afea67225290ee2d8da654db41d..7a104875591400a896ab3025e5feb4e37ec3e86a 100644 (file)
@@ -599,7 +599,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
                        return -EINVAL;
 
                sreq = blk_mq_alloc_request(bdev_get_queue(bdev), WRITE, 0);
-               if (!sreq)
+               if (IS_ERR(sreq))
                        return -ENOMEM;
 
                mutex_unlock(&nbd->tx_lock);