public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: fix uninitialized variable in iscsi
@ 2008-10-29  6:03 Stephen Rothwell
  2008-10-29 15:44 ` Mike Christie
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2008-10-29  6:03 UTC (permalink / raw)
  To: Mike Christie; +Cc: open-iscsi, James E.J. Bottomley, LKML, linux-scsi

[Resend to get through vger's filters, sorry]

drivers/scsi/scsi_transport_iscsi.c: In function 'iscsi_add_session':
drivers/scsi/scsi_transport_iscsi.c:704: warning: 'err' may be used uninitialized in this function

Indeed the error path can be taken without err being set.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/scsi/scsi_transport_iscsi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

I don't know if ENOMEM is the proper error code to return.

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 4a803eb..99855db 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -719,6 +719,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
 						 "Too many iscsi targets. Max "
 						 "number of targets is %d.\n",
 						 ISCSI_MAX_TARGET - 1);
+			err = -ENOMEM;
 			goto release_host;
 		}
 	}
-- 
1.5.6.5

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

* Re: [PATCH] scsi: fix uninitialized variable in iscsi
  2008-10-29  6:03 [PATCH] scsi: fix uninitialized variable in iscsi Stephen Rothwell
@ 2008-10-29 15:44 ` Mike Christie
  2008-10-29 22:38   ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Christie @ 2008-10-29 15:44 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: open-iscsi, James E.J. Bottomley, LKML, linux-scsi

Stephen Rothwell wrote:
> [Resend to get through vger's filters, sorry]
> 
> drivers/scsi/scsi_transport_iscsi.c: In function 'iscsi_add_session':
> drivers/scsi/scsi_transport_iscsi.c:704: warning: 'err' may be used uninitialized in this function
> 
> Indeed the error path can be taken without err being set.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/scsi/scsi_transport_iscsi.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> I don't know if ENOMEM is the proper error code to return.
> 
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index 4a803eb..99855db 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -719,6 +719,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
>  						 "Too many iscsi targets. Max "
>  						 "number of targets is %d.\n",
>  						 ISCSI_MAX_TARGET - 1);
> +			err = -ENOMEM;
>  			goto release_host;
>  		}
>  	}

Thanks for the patch.

I have a patch for this from Benny Halevy already.

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

* Re: [PATCH] scsi: fix uninitialized variable in iscsi
  2008-10-29 15:44 ` Mike Christie
@ 2008-10-29 22:38   ` Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2008-10-29 22:38 UTC (permalink / raw)
  To: Mike Christie; +Cc: open-iscsi, James E.J. Bottomley, LKML, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

Hi Mike,

On Wed, 29 Oct 2008 10:44:12 -0500 Mike Christie <michaelc@cs.wisc.edu> wrote:
>
> I have a patch for this from Benny Halevy already.

OK, good.

BTW, the tree listed in the maintainers file "git
kernel.org:/pub/scm/linux/kernel/mnc/linux-2.6-iscsi.git" doesn't work ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2008-10-29 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29  6:03 [PATCH] scsi: fix uninitialized variable in iscsi Stephen Rothwell
2008-10-29 15:44 ` Mike Christie
2008-10-29 22:38   ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox