* [PATCH] nvme-rdma: fix error code in nvme_rdma_create_ctrl()
@ 2017-06-14 10:46 Dan Carpenter
2017-06-15 12:21 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-14 10:46 UTC (permalink / raw)
To: kernel-janitors
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>
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index e84a74479dd8..8456cb6e2a70 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1940,12 +1940,14 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
/* sanity check icdoff */
if (ctrl->ctrl.icdoff) {
dev_err(ctrl->ctrl.device, "icdoff is not supported!\n");
+ ret = -EINVAL;
goto out_remove_admin_queue;
}
/* sanity check keyed sgls */
if (!(ctrl->ctrl.sgls & (1 << 20))) {
dev_err(ctrl->ctrl.device, "Mandatory keyed sgls are not support\n");
+ ret = -EINVAL;
goto out_remove_admin_queue;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nvme-rdma: fix error code in nvme_rdma_create_ctrl()
2017-06-14 10:46 [PATCH] nvme-rdma: fix error code in nvme_rdma_create_ctrl() Dan Carpenter
@ 2017-06-15 12:21 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2017-06-15 12:21 UTC (permalink / raw)
To: kernel-janitors
On Wed, Jun 14, 2017 at 01:46:45PM +0300, Dan Carpenter wrote:
> 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>
Thanks Dan,
applied to nvme-4.13.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-15 12:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14 10:46 [PATCH] nvme-rdma: fix error code in nvme_rdma_create_ctrl() Dan Carpenter
2017-06-15 12:21 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox