Skip to content

Commit 97e151b

Browse files
zhaoshaneguojinhui-liam
authored andcommitted
bytedance: nbd: Fix null-ptr-deref in nbd_reconnect_socket
The remaining problem about retval of kthread_create needs to be repaired. Also, the nbd_version should be updated from 5 to 6 for having a distinction with nbd-dkms v5. Signed-off-by: Sheng Zhao <sheng.zhao@bytedance.com>
1 parent a3afb7a commit 97e151b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/nbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static struct dentry *nbd_dbg_dir;
153153

154154
#define NBD_DEF_BLKSIZE_BITS 10
155155

156-
static int nbd_version = 5;
156+
static int nbd_version = 6;
157157
static unsigned int nbds_max = 16;
158158
static int max_part = 16;
159159
static int part_shift;
@@ -1156,7 +1156,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
11561156
}
11571157
worker = kthread_create(recv_work, args, "knbd%d.%d-recv",
11581158
nbd->index, i);
1159-
if (!worker) {
1159+
if (IS_ERR(worker)) {
11601160
sockfd_put(sock);
11611161
kfree(args);
11621162
return -ENOMEM;

0 commit comments

Comments
 (0)