Skip to content

Commit

Permalink
[SCSI] mpt fusion: don't oops if NumPhys==0
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Krzysztof Oledzki authored and James Bottomley committed Mar 5, 2008
1 parent 45ab33b commit 51f39ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
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,
Expand Down

0 comments on commit 51f39ea

Please sign in to comment.