Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9179669pxu; Mon, 28 Dec 2020 08:33:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyX4IQjiUR+7RK9XYsmSp4NRdxwjwfJ2ow1JkzwgEaJhoEdXSvDagL5PXjWRNz5/IMy4rHl X-Received: by 2002:a17:906:358c:: with SMTP id o12mr35265206ejb.301.1609173215288; Mon, 28 Dec 2020 08:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173215; cv=none; d=google.com; s=arc-20160816; b=y/Cr/cXclJFwSYyam41XkWejT/K0F+mDBmZ5EA7/OoZMdbTNAv/pCZ6UNWezQdtDM0 4GbMqDJdk1gx92jmY79H/BIHNPVRjVWxTBKikKqd4jV5TxDTTJi2Qz+RHwA04Q9fxb5g +060Yqhmh0vHUHrG8vyqcLuYjBCwBPAcQbYAGjWPu0RFx6EVWCvSoNOkQOmw75H0Ko+S 2J6BveyS2ZEYqybC4p7HLAFWR3J9ftB41jURWByxskIeCE+mDExYaN4TZHqkvNEi20KL VKyk0+4Bv9kZESICRhzl8zHheHsLgcUZp6fmUXOGKlXBHOr9Yb+4SmteebJlT3XtB8pt Q1Pg== 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=DqRPPSuXs9eK74YFaYGhYte2RqtLsy5onwasCf9Gi7A=; b=v3p1URArabHGepN7z1TVY22AqXaapfhGJr9EEB+4EzpUhkOtwog81mAlyeG0Tzfl59 ZLXt28U3NHStXHG5MIsx5lnuiL6S8Tm2dxf6jjJpcOSZbQSXq003vi2LzM5SHDKetLAr q+lAYaX5z6H2vu4NezDtQfKiGrLZYf8e2bmnoe2JhKiwtCyEishPsRvGt4oAI0taYFhK 4SHj178v0Lit4L2BgN0fNOPMOGUwRdqTpUagJwpk5lVv5JCjz2b+fDw1vCGxlOZIiuBg LGZ8RPoK1fWJIhXOMvigxdehbLjR2T7C/qJe1efcI6cbQt2MtZG0mpnoVRYxA1J1E9Am ISOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pjixkbC4; 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 he7si17654841ejc.676.2020.12.28.08.33.12; Mon, 28 Dec 2020 08:33:35 -0800 (PST) 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=pjixkbC4; 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 S2634044AbgL1Qbg (ORCPT + 99 others); Mon, 28 Dec 2020 11:31:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:32854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730525AbgL1NEy (ORCPT ); Mon, 28 Dec 2020 08:04:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3754208D5; Mon, 28 Dec 2020 13:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160653; bh=Rly/IMK4SHISlyefPIldBfTI4/G1zP6YXDYT7WQekaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjixkbC4UOrXZDFhDTUKcKX0c8laT0o/oPdrgLcIwkZEQgLBMiPR+mmLY8gzIKL8r ThpS7PN92qifKCq1K40bLioDTsC9oaAKlDyRM36JKEnIz8FElPrixuhRxd5liEy3kj Fz3CLO8kXmR9JCakdZECQdydfTztATgs1fvu6y6I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Xiangfeng , Ulf Hansson , Sasha Levin Subject: [PATCH 4.9 094/175] memstick: r592: Fix error return in r592_probe() Date: Mon, 28 Dec 2020 13:49:07 +0100 Message-Id: <20201228124857.796335730@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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: Jing Xiangfeng [ Upstream commit db29d3d1c2451e673e29c7257471e3ce9d50383a ] Fix to return a error code from the error handling case instead of 0. Fixes: 926341250102 ("memstick: add driver for Ricoh R5C592 card reader") Signed-off-by: Jing Xiangfeng Link: https://lore.kernel.org/r/20201125014718.153563-1-jingxiangfeng@huawei.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/memstick/host/r592.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c index d5cfb503b9d69..2539984c1db1c 100644 --- a/drivers/memstick/host/r592.c +++ b/drivers/memstick/host/r592.c @@ -762,8 +762,10 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto error3; dev->mmio = pci_ioremap_bar(pdev, 0); - if (!dev->mmio) + if (!dev->mmio) { + error = -ENOMEM; goto error4; + } dev->irq = pdev->irq; spin_lock_init(&dev->irq_lock); @@ -790,12 +792,14 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) &dev->dummy_dma_page_physical_address, GFP_KERNEL); r592_stop_dma(dev , 0); - if (request_irq(dev->irq, &r592_irq, IRQF_SHARED, - DRV_NAME, dev)) + error = request_irq(dev->irq, &r592_irq, IRQF_SHARED, + DRV_NAME, dev); + if (error) goto error6; r592_update_card_detect(dev); - if (memstick_add_host(host)) + error = memstick_add_host(host); + if (error) goto error7; message("driver successfully loaded"); -- 2.27.0