All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-rdma: initialize ret to zero to avoid returning garbage
@ 2016-08-16  8:24 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2016-08-16  8:24 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, linux-nvme; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

ret is not initialized so it contains garbage.  Ensure garbage
is not returned by initializing rc to 0.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/nvme/host/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 8d2875b..9c69393 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1319,7 +1319,7 @@ out_destroy_queue_ib:
 static int nvme_rdma_device_unplug(struct nvme_rdma_queue *queue)
 {
 	struct nvme_rdma_ctrl *ctrl = queue->ctrl;
-	int ret;
+	int ret = 0;
 
 	/* Own the controller deletion */
 	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING))
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] nvme-rdma: initialize ret to zero to avoid returning garbage
@ 2016-08-16  8:24 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2016-08-16  8:24 UTC (permalink / raw)


From: Colin Ian King <colin.king@canonical.com>

ret is not initialized so it contains garbage.  Ensure garbage
is not returned by initializing rc to 0.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 drivers/nvme/host/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 8d2875b..9c69393 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1319,7 +1319,7 @@ out_destroy_queue_ib:
 static int nvme_rdma_device_unplug(struct nvme_rdma_queue *queue)
 {
 	struct nvme_rdma_ctrl *ctrl = queue->ctrl;
-	int ret;
+	int ret = 0;
 
 	/* Own the controller deletion */
 	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING))
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme-rdma: initialize ret to zero to avoid returning garbage
  2016-08-16  8:24 ` Colin King
@ 2016-08-16  9:06   ` Sagi Grimberg
  -1 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2016-08-16  9:06 UTC (permalink / raw)
  To: Colin King, Keith Busch, Jens Axboe, linux-nvme; +Cc: linux-kernel



On 16/08/16 11:24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> ret is not initialized so it contains garbage.  Ensure garbage
> is not returned by initializing rc to 0.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/nvme/host/rdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 8d2875b..9c69393 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -1319,7 +1319,7 @@ out_destroy_queue_ib:
>  static int nvme_rdma_device_unplug(struct nvme_rdma_queue *queue)
>  {
>  	struct nvme_rdma_ctrl *ctrl = queue->ctrl;
> -	int ret;
> +	int ret = 0;
>
>  	/* Own the controller deletion */
>  	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING))
>

Applied for the next round of rc fixes.

Thanks Colin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] nvme-rdma: initialize ret to zero to avoid returning garbage
@ 2016-08-16  9:06   ` Sagi Grimberg
  0 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2016-08-16  9:06 UTC (permalink / raw)




On 16/08/16 11:24, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> ret is not initialized so it contains garbage.  Ensure garbage
> is not returned by initializing rc to 0.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  drivers/nvme/host/rdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 8d2875b..9c69393 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -1319,7 +1319,7 @@ out_destroy_queue_ib:
>  static int nvme_rdma_device_unplug(struct nvme_rdma_queue *queue)
>  {
>  	struct nvme_rdma_ctrl *ctrl = queue->ctrl;
> -	int ret;
> +	int ret = 0;
>
>  	/* Own the controller deletion */
>  	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING))
>

Applied for the next round of rc fixes.

Thanks Colin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-16  9:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-16  8:24 [PATCH] nvme-rdma: initialize ret to zero to avoid returning garbage Colin King
2016-08-16  8:24 ` Colin King
2016-08-16  9:06 ` Sagi Grimberg
2016-08-16  9:06   ` Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.