Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Eric Youngdale <eric@andante.org>,
	"James E. J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] fix potential return of uninitialized variable in scsi_scan   (resend)
Date: Sat, 18 Mar 2006 22:42:52 +0100	[thread overview]
Message-ID: <200603182242.52507.jesper.juhl@gmail.com> (raw)

( The patch below was already send on March 9, 2006. )
( This is a resend, re-diff'ed against 2.6.16-rc6    )


The coverity checker found out that we potentially return sdev uninitialized.
This should fix coverity #879

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/scsi/scsi_scan.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.16-rc6-orig/drivers/scsi/scsi_scan.c	2006-03-12 14:19:00.000000000 +0100
+++ linux-2.6.16-rc6/drivers/scsi/scsi_scan.c	2006-03-18 22:37:53.000000000 +0100
@@ -1277,7 +1277,9 @@ struct scsi_device *__scsi_add_device(st
 					     hostdata);
 		if (res != SCSI_SCAN_LUN_PRESENT)
 			sdev = ERR_PTR(-ENODEV);
-	}
+	} else 
+		sdev = ERR_PTR(-EACCES);
+
 	mutex_unlock(&shost->scan_mutex);
 	scsi_target_reap(starget);
 	put_device(&starget->dev);



             reply	other threads:[~2006-03-18 21:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-18 21:42 Jesper Juhl [this message]
2006-03-18 23:10 ` [PATCH] fix potential return of uninitialized variable in scsi_scan (resend) James Bottomley
2006-03-18 23:22   ` Jesper Juhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603182242.52507.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akpm@osdl.org \
    --cc=eric@andante.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox