Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1529176pxb; Thu, 16 Sep 2021 09:18:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOkiLCIMNpRjx3+FEVLAGPr26cQ6rFmH8UMu7XakAu5rOKyxeMJOJfo9hgqmmH0FEZGzfa X-Received: by 2002:a17:906:498b:: with SMTP id p11mr7157142eju.295.1631809092406; Thu, 16 Sep 2021 09:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809092; cv=none; d=google.com; s=arc-20160816; b=Ouckqckj5MCWwJdNdEIlvkhZk2QISF8hTEiysv9TnPHV1wsDUs/Tpwsz8mm3gsr8uS hzmICgFiSWzfj8Ts0OOmCX+KudqwEJMFHNJWeS1iJ3f5H+f6GykzttLhd1UmhklIYZsD gAaJAMMwXQ9ZF9Dux1Av+53dwrDav3ijvggsBBgJNhEAK1rIK3Zneun+U3K7bLnCqdse 7Q1I7IJhgNc/zpfmkkTeY4+oEb9kbyxDRVBTljACuxXDb22nnyBF4eQSzHT5okIhRueR 1lu4OC4g8viwE4ftJLSToeQgr2G/dg5Ymc8a6vsz9m0jwD+SHlFzHKULHy96Hx/9G0MB 5enw== 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=sUkTTnVJWCOnQU3z0zqlShokKf1fzT+CRRYfvWWa2WzpBor9Uu1/cTJFa9vfKwyN/F EDJxBK0P3eoyAuR5WP+/moAMhL3kHloHVdPTH3m6hMM/QFrHQMmRB3fOI8T9X8jkBLSN EH74HylSV2aTP0qtNc5CJkgN1N16S3YrrSqW8ri2RNaP4JNVJDfWWFMLSruD47F7cXJg MbC2+m3pG2njVEODQC1cp6GTfiTJaDtfkbWXaIbvH7pb0AHsqMlrZW0UbjGDSktQKiaP waPq6WIIEQY6MiGosl/l82Z/pDZwcMCtCfYZ0KVY4TgiI9P03APvPP2+pWDxWZVJ0Jsb WVEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qBOhFTFp; 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 eb10si2927554edb.16.2021.09.16.09.17.48; Thu, 16 Sep 2021 09:18:12 -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=qBOhFTFp; 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 S234941AbhIPQNf (ORCPT + 99 others); Thu, 16 Sep 2021 12:13:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:48498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234548AbhIPQIN (ORCPT ); Thu, 16 Sep 2021 12:08:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 620196121F; Thu, 16 Sep 2021 16:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808412; bh=7jspRymjruWv8ZVQQoIyyjjJyKqgfsOq/RILWjA1krM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qBOhFTFpS7U3WddKmNbKkSj+guWQZXU8eegwkKbWGVNPqsFrgHMjhChJe9DCxAUcs goEPoze7K4YzqxB+Nz/hXqVgocGJ27F28FJluPx5PvD/Q5GjKhX7rIDp8bnnemjN1I DhCk8lk+eUhQ5hOS26dY7MBHWF28YTlqTOVr/gDU= 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.10 082/306] scsi: fdomain: Fix error return code in fdomain_probe() Date: Thu, 16 Sep 2021 17:57:07 +0200 Message-Id: <20210916155756.846763809@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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