mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
nvme-rdma: fix error code in nvme_rdma_create_ctrl()
We accidentally return ERR_PTR(0) which is NULL. The caller isn't explicitly checking for that but I couldn't immediately spot whether this would lead to a NULL dereference. Anyway, we can fix add an error code easily enough. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
97ddc36e4e
commit
bb472baa23
1 changed files with 2 additions and 0 deletions
|
@ -1919,12 +1919,14 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
|
||||||
/* sanity check icdoff */
|
/* sanity check icdoff */
|
||||||
if (ctrl->ctrl.icdoff) {
|
if (ctrl->ctrl.icdoff) {
|
||||||
dev_err(ctrl->ctrl.device, "icdoff is not supported!\n");
|
dev_err(ctrl->ctrl.device, "icdoff is not supported!\n");
|
||||||
|
ret = -EINVAL;
|
||||||
goto out_remove_admin_queue;
|
goto out_remove_admin_queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check keyed sgls */
|
/* sanity check keyed sgls */
|
||||||
if (!(ctrl->ctrl.sgls & (1 << 20))) {
|
if (!(ctrl->ctrl.sgls & (1 << 20))) {
|
||||||
dev_err(ctrl->ctrl.device, "Mandatory keyed sgls are not support\n");
|
dev_err(ctrl->ctrl.device, "Mandatory keyed sgls are not support\n");
|
||||||
|
ret = -EINVAL;
|
||||||
goto out_remove_admin_queue;
|
goto out_remove_admin_queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue