diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-11-11 19:42:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-11-11 19:42:03 -0500 |
commit | 5f3a5cb8e7d7334cfc42312ff58292bb0e7f5941 (patch) | |
tree | 06548705767ec98371192ddafa69c9c51bf4583a /drivers | |
parent | 8233008f5d9703207c2a725cbfb7fd00e7e025e6 (diff) | |
parent | d8e9e5e80e882b4f90cba7edf1e6cb7376e52e54 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 2 | ||||
-rw-r--r-- | drivers/block/nbd.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 100be556e613..83482721bc01 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -1871,7 +1871,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock, | |||
1871 | drbd_update_congested(connection); | 1871 | drbd_update_congested(connection); |
1872 | } | 1872 | } |
1873 | do { | 1873 | do { |
1874 | rv = kernel_sendmsg(sock, &msg, &iov, 1, size); | 1874 | rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len); |
1875 | if (rv == -EAGAIN) { | 1875 | if (rv == -EAGAIN) { |
1876 | if (we_should_drop_the_connection(connection, sock)) | 1876 | if (we_should_drop_the_connection(connection, sock)) |
1877 | break; | 1877 | break; |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 19a16b2dbb91..7a1048755914 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -599,7 +599,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, | |||
599 | return -EINVAL; | 599 | return -EINVAL; |
600 | 600 | ||
601 | sreq = blk_mq_alloc_request(bdev_get_queue(bdev), WRITE, 0); | 601 | sreq = blk_mq_alloc_request(bdev_get_queue(bdev), WRITE, 0); |
602 | if (!sreq) | 602 | if (IS_ERR(sreq)) |
603 | return -ENOMEM; | 603 | return -ENOMEM; |
604 | 604 | ||
605 | mutex_unlock(&nbd->tx_lock); | 605 | mutex_unlock(&nbd->tx_lock); |