We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c8a951 commit 969127bCopy full SHA for 969127b
drivers/block/ublk_drv.c
@@ -2849,7 +2849,8 @@ static int ublk_ctrl_add_dev(const struct ublksrv_ctrl_cmd *header)
2849
if (copy_from_user(&info, argp, sizeof(info)))
2850
return -EFAULT;
2851
2852
- if (info.queue_depth > UBLK_MAX_QUEUE_DEPTH || info.nr_hw_queues > UBLK_MAX_NR_QUEUES)
+ if (info.queue_depth > UBLK_MAX_QUEUE_DEPTH || !info.queue_depth ||
2853
+ info.nr_hw_queues > UBLK_MAX_NR_QUEUES || !info.nr_hw_queues)
2854
return -EINVAL;
2855
2856
if (capable(CAP_SYS_ADMIN))
0 commit comments