Skip to content

Commit 5f3a5cb

Browse files
committed
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
2 parents 8233008 + d8e9e5e commit 5f3a5cb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/block/drbd/drbd_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
18711871
drbd_update_congested(connection);
18721872
}
18731873
do {
1874-
rv = kernel_sendmsg(sock, &msg, &iov, 1, size);
1874+
rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);
18751875
if (rv == -EAGAIN) {
18761876
if (we_should_drop_the_connection(connection, sock))
18771877
break;

drivers/block/nbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
599599
return -EINVAL;
600600

601601
sreq = blk_mq_alloc_request(bdev_get_queue(bdev), WRITE, 0);
602-
if (!sreq)
602+
if (IS_ERR(sreq))
603603
return -ENOMEM;
604604

605605
mutex_unlock(&nbd->tx_lock);

0 commit comments

Comments
 (0)