Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9226234pxu; Mon, 28 Dec 2020 09:48:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfo5fRF1bbtzOs1dsUdr+wrGK4hMuwqIsCqndWfFzyNSqgCD3MmsDFdtpLfvhjDoB4IE4d X-Received: by 2002:a05:6402:407:: with SMTP id q7mr43133692edv.312.1609177721271; Mon, 28 Dec 2020 09:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609177721; cv=none; d=google.com; s=arc-20160816; b=nqifP/otw0uL0qiGaBJo6ZjIeAJUp4p98JvZ0FfXYOr58lUBE6GySfl4rXIAyohS3j ZgigozvDAiQrckX0+u0lfHB+NFU+NHZqUc/KuIot9d1gGdZF1u1PuJKXmMZXFy9MWx/v 6iTFQNWlnit6Si+cjh0tZcKdPnvsI+goMK7Qobil6har0kBT1hah8ib1sk7Rn1RudukT t7N81iYb+EO8yTbqd9jgWX9vEdvDrWMoVXAmGtZT4NIYPYIAqnIhMQPtF8+HhilBGpqn qIjzldHslkdEYKUBiehtd7B82EB3rck++6xNdWhL1Ur7tTlOjvCQk2zJZgQZphlncMV7 +yTg== 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=iy0GhO1OAN9Tgd9ecz7CpiKhu/UfZktSuqdu0aIn7alhFsin5I/CGoqqQ3XfIWjbti yMVQc/Hj0CCwXd2htARn7eJ/jKVL/hKv9sDBuTb6nlePmanUIZNhNX21HPou49nLI2eY glxvFxlPmBirPLL0yeUBB+9WlOP1hXQ9jjyyCOdmJiZbFFZDrwj985l16M5kEKlzgyoA 3nwN/+0vmiGDC0OHMKoJljYBMeSB891BwUUIUMU+aCs3P7jS7Co8Ywb8xakWC5DWiEES Uiuielbccz4U2egiQy5BOiDNYEhsutfbjgVqJKiBbvTCw07bJT1CdD9mRNp6gwpO/Vnz 4iwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VDil4Ir7; 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 b26si19003887ejz.630.2020.12.28.09.48.18; Mon, 28 Dec 2020 09:48:41 -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=VDil4Ir7; 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 S1732386AbgL1NOE (ORCPT + 99 others); Mon, 28 Dec 2020 08:14:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:42170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732364AbgL1NOB (ORCPT ); Mon, 28 Dec 2020 08:14:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18444207F7; Mon, 28 Dec 2020 13:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161200; bh=Rly/IMK4SHISlyefPIldBfTI4/G1zP6YXDYT7WQekaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VDil4Ir7BlibCTmkixFwaUUCQxhqGhOqvtLJRKA4uQWDvSgpcX+rBLPIzx7HOuLem emtKePtLL83Sgboh94NPR8aCxzP5HK2d2HD2t78XNNQBEn/FQRWPr1aFevnOtl4uU3 oY95NxdaXYEdec5LjPYcXMyXXS4I4bGIbVXC2ViQ= 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.14 134/242] memstick: r592: Fix error return in r592_probe() Date: Mon, 28 Dec 2020 13:48:59 +0100 Message-Id: <20201228124911.302972784@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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