From: "Stephen M. Cameron" Subject: [PATCH 3/5] hpsa: make hpsa_init_one return -ENOMEM if allocation of h->lockup_detected fails Date: Thu, 03 Jul 2014 10:18:08 -0500 Message-ID: <20140703151808.22132.99138.stgit@beardog.cce.hp.com> References: <20140703151534.22132.49663.stgit@beardog.cce.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from g2t1383g.austin.hp.com ([15.217.136.92]:34701 "EHLO g2t1383g.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758265AbaGCPTN (ORCPT ); Thu, 3 Jul 2014 11:19:13 -0400 Received: from g5t1625.atlanta.hp.com (g5t1625.atlanta.hp.com [15.192.137.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by g2t1383g.austin.hp.com (Postfix) with ESMTPS id B3C6F1F19 for ; Thu, 3 Jul 2014 14:59:49 +0000 (UTC) In-Reply-To: <20140703151534.22132.49663.stgit@beardog.cce.hp.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: james.bottomley@parallels.com Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, stephenmcameron@gmail.com, joseph.t.handzik@hp.com, thenzl@redhat.com, michael.miller@canonical.com, elliott@hp.com, scott.teel@hp.com, hch@lst.de From: Stephen M. Cameron Signed-off-by: Stephen M. Cameron Reviewed-by: Joe Handzik --- drivers/scsi/hpsa.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 08b34e9..794d726 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -6999,8 +6999,10 @@ reinit_after_soft_reset: /* Allocate and clear per-cpu variable lockup_detected */ h->lockup_detected = alloc_percpu(u32); - if (!h->lockup_detected) + if (!h->lockup_detected) { + rc = -ENOMEM; goto clean1; + } set_lockup_detected_for_all_cpus(h, 0); rc = hpsa_pci_init(h);