linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] csiostor: fix an error code in csio_hw_init()
@ 2015-04-14 14:32 Dan Carpenter
  2015-04-16 12:22 ` Tomas Henzl
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-04-14 14:32 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: David S. Miller, Hariprasad Shenai, Praveen Madhavan, linux-scsi,
	kernel-janitors

We should return -ENOMEM if kzalloc() fails here instead of returning
success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index 2e66f34..622bdab 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -3928,6 +3928,7 @@ csio_hw_init(struct csio_hw *hw)
 
 		evt_entry = kzalloc(sizeof(struct csio_evt_msg), GFP_KERNEL);
 		if (!evt_entry) {
+			rv = -ENOMEM;
 			csio_err(hw, "Failed to initialize eventq");
 			goto err_evtq_cleanup;
 		}

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

* Re: [patch] csiostor: fix an error code in csio_hw_init()
  2015-04-14 14:32 [patch] csiostor: fix an error code in csio_hw_init() Dan Carpenter
@ 2015-04-16 12:22 ` Tomas Henzl
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Henzl @ 2015-04-16 12:22 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley
  Cc: David S. Miller, Hariprasad Shenai, Praveen Madhavan, linux-scsi,
	kernel-janitors

On 04/14/2015 04:32 PM, Dan Carpenter wrote:
> We should return -ENOMEM if kzalloc() fails here instead of returning
> success.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
> index 2e66f34..622bdab 100644
> --- a/drivers/scsi/csiostor/csio_hw.c
> +++ b/drivers/scsi/csiostor/csio_hw.c
> @@ -3928,6 +3928,7 @@ csio_hw_init(struct csio_hw *hw)
>  
>  		evt_entry = kzalloc(sizeof(struct csio_evt_msg), GFP_KERNEL);
>  		if (!evt_entry) {
> +			rv = -ENOMEM;
>  			csio_err(hw, "Failed to initialize eventq");
>  			goto err_evtq_cleanup;
>  		}
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas


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

end of thread, other threads:[~2015-04-16 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 14:32 [patch] csiostor: fix an error code in csio_hw_init() Dan Carpenter
2015-04-16 12:22 ` Tomas Henzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).