From patchwork Tue Jun 23 19:57:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00AF2C433E0 for ; Tue, 23 Jun 2020 21:12:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9CA520702 for ; Tue, 23 Jun 2020 21:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592946736; bh=696GkuCbVkV5a3oREAEsISji8t2VPfQIB6Ta3bXYlEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JHGRegA/JtJk/B4HujxBzAFKjW9ZIDCL6hrFTKzLedRoq92tGks8QNKiHFNGcivXb XVYlxcpgbGuU8xYp9xrizMKHX1UaSlpVvGKsHL+B8U9jeV9mRm+LJ7/EDuMRJkCHCF VNT8ZN9mlw09i7pAQiVvqZ99iNSHLx1hzFx8OoZA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390489AbgFWUbq (ORCPT ); Tue, 23 Jun 2020 16:31:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:52452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391235AbgFWUbo (ORCPT ); Tue, 23 Jun 2020 16:31:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42BBB20702; Tue, 23 Jun 2020 20:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944304; bh=696GkuCbVkV5a3oREAEsISji8t2VPfQIB6Ta3bXYlEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mUsLNhp9A6ekhhcsIorv8UBuIVN7UQYqkHhKY9dtqN5P7Yx+B+RW3HO2NSWH640Qx P1EgwPyJaLhOaJeP4eKEwURqDA2LcULYaaUym9OVtrt8Q8O3bK3F6/T1DoEIe9zhYX cZyAMmskOy3MW2fWceRhrKtFLSxeN7trzySrzHmg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.4 252/314] scsi: acornscsi: Fix an error handling path in acornscsi_probe() Date: Tue, 23 Jun 2020 21:57:27 +0200 Message-Id: <20200623195350.980797938@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195338.770401005@linuxfoundation.org> References: <20200623195338.770401005@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET [ Upstream commit 42c76c9848e13dbe0538d7ae0147a269dfa859cb ] 'ret' is known to be 0 at this point. Explicitly return -ENOMEM if one of the 'ecardm_iomap()' calls fail. Link: https://lore.kernel.org/r/20200530081622.577888-1-christophe.jaillet@wanadoo.fr Fixes: e95a1b656a98 ("[ARM] rpc: acornscsi: update to new style ecard driver") Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/arm/acornscsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index d12dd89538df2..deab66598910d 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -2911,8 +2911,10 @@ static int acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ashost->base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0); ashost->fast = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); - if (!ashost->base || !ashost->fast) + if (!ashost->base || !ashost->fast) { + ret = -ENOMEM; goto out_put; + } host->irq = ec->irq; ashost->host = host;