Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932298AbYCUXNA (ORCPT ); Fri, 21 Mar 2008 19:13:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763147AbYCUWwd (ORCPT ); Fri, 21 Mar 2008 18:52:33 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:41338 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932207AbYCUWw2 (ORCPT ); Fri, 21 Mar 2008 18:52:28 -0400 Message-Id: <20080321224441.028170945@sous-sol.org> References: <20080321224250.144333319@sous-sol.org> User-Agent: quilt/0.46-1 Date: Fri, 21 Mar 2008 15:43:52 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Krzysztof Oledzki , Krzysztof Piotr Oledzki , Eric Moore , James Bottomley , Greg Kroah-Hartman Subject: [patch 62/76] SCSI: mpt fusion: dont oops if NumPhys==0 Content-Disposition: inline; filename=scsi-mpt-fusion-don-t-oops-if-numphys-0.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1292 Lines: 39 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Krzysztof Oledzki 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 Acked-by: Eric Moore Signed-off-by: Andrew Morton Signed-off-by: James Bottomley Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- 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, -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/