Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9115815pxu; Mon, 28 Dec 2020 07:03:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbmJJsvbAu7PbyvNzGYPt5Q7oBgvu784K3emGGOciqgjm2LUDWbegp/A9sfXNQHqDhdFKJ X-Received: by 2002:aa7:d75a:: with SMTP id a26mr41312309eds.230.1609167789017; Mon, 28 Dec 2020 07:03:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167789; cv=none; d=google.com; s=arc-20160816; b=hDt/60LKZ43LtMYHYVSZjnuwyKTHSBBCQ+t8CWllmiYpnGx4643koeTEc9BlgWIU14 ZFh2YyMVMKZzF9CDTiygtbKDQIXWwhCfbvuyIKHX1Yl9VgogGZZ1KxJOxBXBrZ9vhp7x uRCcjBAomWusYL9rWE0Du26QMAV2zIb1SOtHKRDd9yFQxqRdbafRR6tzcocwgXfHiT1p 5e9HRNwJZTgZ794aJBjBcO6ogK7NJZewNnDzoSm48aBYfN8h8wUd9OijXeIu8Wi38x5T VI0mewIphZVteqn/RgXDaGpwnHLl4OkCcKROKGQIlmMcvylqRiE5yBfjuZLL38feYDh3 Fefg== 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=l//chfItf/7uPJc0hRMZQDVaKIG1At7UdZANzSiYSbc=; b=xGYfW1qUG0pXGfreGjfnY9fUb9t6u00L87MdNKjRYiCnZnxfEQ0jbQvt2g6uM904EY BP89wj87vudJOepv7RYV5hRd+AicnouXnAA4Dc/bJxgIjSev/LnpkV1WY9BcokUUzxfN /EDXLLmliqBVp+EFMJqYIOyrnhwG1MN0aw5K6Nk18TGIZNSbZYq3RrVPzzAB5Uj78fUS 2q9ok/1/4o2zxlSSdjHurCAReXSXqssFDuHWPiLM74R2Qhw+8X9kcr6HCUlYHXYMb25g WEUezxbYMg13WNZYIk1pmFWLNN6It7x9mpPQSAR1ZyemPCFkWYilYT8EQptnUk2SXDhE QISQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EwPaxwZ2; 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 u9si20567693edd.596.2020.12.28.07.02.46; Mon, 28 Dec 2020 07:03:09 -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=EwPaxwZ2; 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 S2440171AbgL1ONa (ORCPT + 99 others); Mon, 28 Dec 2020 09:13:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:47866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440179AbgL1ON3 (ORCPT ); Mon, 28 Dec 2020 09:13:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1FFCD20715; Mon, 28 Dec 2020 14:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164793; bh=aVFpPXGvmw0OX3WEYtjlnggwAkKFDkbWOUwsy8Faa/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EwPaxwZ25xP8CELDWFH/1/HMzwwFUXEoru3zb9VuL1wj1SXA15lr3uXHHIBsZWWGp AdY1N8zbUpy6esPe22RUXpwqBbGK0GuwubnGQpuDu3c/QZ3Ln9lhOhx/Dajf40Oxx7 deJgLSGxhX4zC/UaZcxAW2hYUaly8z9nQq0hlbOM= 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 5.10 300/717] memstick: r592: Fix error return in r592_probe() Date: Mon, 28 Dec 2020 13:44:58 +0100 Message-Id: <20201228125035.401919220@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 dd3a1f3dcc191..d2ef46337191c 100644 --- a/drivers/memstick/host/r592.c +++ b/drivers/memstick/host/r592.c @@ -759,8 +759,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); @@ -786,12 +788,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