diff options
author | Krzysztof Oledzki <olel@ans.pl> | 2008-03-04 17:56:23 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-03-05 15:57:57 -0500 |
commit | 51f39eae14b4874618e73281c236e3a1c1572d4d (patch) | |
tree | 1835811c57a5022f8f0724d00fa57abcf3e744c7 /drivers/message/fusion | |
parent | 45ab33b6c190c4a8c58f1d13be2ff89ee62024ba (diff) |
[SCSI] mpt fusion: don't oops if NumPhys==0
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 <ole@ans.pl>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index f77b329f6923..78734e25edd5 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -1701,6 +1701,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info, | |||
1701 | if (error) | 1701 | if (error) |
1702 | goto out_free_consistent; | 1702 | goto out_free_consistent; |
1703 | 1703 | ||
1704 | if (!buffer->NumPhys) { | ||
1705 | error = -ENODEV; | ||
1706 | goto out_free_consistent; | ||
1707 | } | ||
1708 | |||
1704 | /* save config data */ | 1709 | /* save config data */ |
1705 | port_info->num_phys = buffer->NumPhys; | 1710 | port_info->num_phys = buffer->NumPhys; |
1706 | port_info->phy_info = kcalloc(port_info->num_phys, | 1711 | port_info->phy_info = kcalloc(port_info->num_phys, |