Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2339634pxb; Mon, 20 Sep 2021 19:22:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRbOWySAscGXqR4DfZUel4NScufXB/B3Sx1LhspucQEBGGEjqMrVOcg3j3Gt12D5XgwAlk X-Received: by 2002:a17:906:b052:: with SMTP id bj18mr33474227ejb.55.1632190944434; Mon, 20 Sep 2021 19:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632190944; cv=none; d=google.com; s=arc-20160816; b=uSP0UdJOjQ5KhPgp7AKdJ2V30tzMIXmh4XSMV3qy1NK8DYZL3OFjsPzGf80IDiZUCv U5qYa0ycvDOiBPzNQNXdu6PgNHF0SE52w8s6H7K+blo/colIdLvHif1fdIkvmWbOThQ7 HYLpNPgGM3rtpsIHaAFaGbzZfAAvOGoGgiB83lc6zJBw19p434kUbJB6vbWq9oH+IRna SbPDB1Y8dWs9LrjxCPkjimvHW4fAcbV/KgCL0j2sWU3SwjYGbzTkaFyo/jRX8Uj6MpD0 3Dd4tt1/XCqfe3ysJq9VhKsOhcxzwL9QN5o80OFFhyJz+1MuSYfAy/PNKKTemETNZ81z Pu2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KyZ42bnA8MQJCDCrFRaIPvTWp3WUXh6sT8Ij5ivl6rw=; b=tDcekwMkwC1P9N4NadQDb6Q+KO2vw22wgT3YWrtuEIBefbtSA1yk4Sdsy2hsxBNIJo 0kRMjzxtv8Ca6aJg21ODGAzcnXVmNTiHjsD7zf6QqqAFH4A0kWNI5rR+Pc8IGzz7yIcw 0nt/CNfpBLLRaElttQl0wg2t2eSbtZpxbVEiii9qOlSA00E2+j4e19xJFE/C0bHXDmlg 6rKDgpDkP7+Gz+0Mp2JZPczaOBaNgZXxp1uLbez0Hjnb+FCiJfX+uNJACREFjXa45qq5 Za7bBZUFxVwyCPvHRYjAS75De+j2bnO5AeI76ru+WcworByPmMyiw/gpC6JT+sdJ7lHe 9z0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LOkSGxU7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd5si12956735ejc.375.2021.09.20.19.22.00; Mon, 20 Sep 2021 19:22:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LOkSGxU7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351045AbhITSMZ (ORCPT + 99 others); Mon, 20 Sep 2021 14:12:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:60506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358464AbhITSGp (ORCPT ); Mon, 20 Sep 2021 14:06:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A378D61A0B; Mon, 20 Sep 2021 17:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158280; bh=7jspRymjruWv8ZVQQoIyyjjJyKqgfsOq/RILWjA1krM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LOkSGxU76kx/sOdP5peqG/azaiCMs3ihCBI+wlhjkdUQuOtodKVDbIsqmROkqLx1n lO4g3B5UwmU5Th2Y5UfMVqJpP2UCT1ipQZN7GH/3Mm+YuQr4U5/EpN1KWf+2GGEixK FDfrHc3ah6bRo+dItnDFKqR9CFhD9Zs4sjzJN/l4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Li , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.4 051/260] scsi: fdomain: Fix error return code in fdomain_probe() Date: Mon, 20 Sep 2021 18:41:09 +0200 Message-Id: <20210920163932.842490887@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Li [ Upstream commit 632c4ae6da1d629eddf9da1e692d7617c568c256 ] If request_region() fails the return value is not set. Return -EBUSY on error. Link: https://lore.kernel.org/r/20210715032625.1395495-1-liwei391@huawei.com Fixes: 8674a8aa2c39 ("scsi: fdomain: Add PCMCIA support") Reported-by: Hulk Robot Signed-off-by: Wei Li Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pcmcia/fdomain_cs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/pcmcia/fdomain_cs.c b/drivers/scsi/pcmcia/fdomain_cs.c index e42acf314d06..33df6a9ba9b5 100644 --- a/drivers/scsi/pcmcia/fdomain_cs.c +++ b/drivers/scsi/pcmcia/fdomain_cs.c @@ -45,8 +45,10 @@ static int fdomain_probe(struct pcmcia_device *link) goto fail_disable; if (!request_region(link->resource[0]->start, FDOMAIN_REGION_SIZE, - "fdomain_cs")) + "fdomain_cs")) { + ret = -EBUSY; goto fail_disable; + } sh = fdomain_create(link->resource[0]->start, link->irq, 7, &link->dev); if (!sh) { -- 2.30.2