2008-03-21 23:13:00

by Chris Wright

[permalink] [raw]
Subject: [patch 62/76] SCSI: mpt fusion: dont oops if NumPhys==0

-stable review patch. If anyone has any objections, please let us know.
---------------------

From: Krzysztof Oledzki <[email protected]>

Don't oops if NumPhys==0, instead return -ENODEV.
This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=9909

Signed-off-by: Krzysztof Piotr Oledzki <[email protected]>
Acked-by: Eric Moore <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
Signed-off-by: Chris Wright <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/message/fusion/mptsas.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1699,6 +1699,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc
if (error)
goto out_free_consistent;

+ if (!buffer->NumPhys) {
+ error = -ENODEV;
+ goto out_free_consistent;
+ }
+
/* save config data */
port_info->num_phys = buffer->NumPhys;
port_info->phy_info = kcalloc(port_info->num_phys,

--