[PATCH] fix potential return of uninitialized variable in scsi_scan (resend)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



( 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 <[email protected]>
---

 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);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux