linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  memstick: r592: Fix error return in r592_probe()
@ 2020-11-25  1:47 Jing Xiangfeng
  2020-12-04 14:37 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Jing Xiangfeng @ 2020-11-25  1:47 UTC (permalink / raw)
  To: maximlevitsky, oakad, ulf.hansson, akpm
  Cc: linux-mmc, linux-kernel, jingxiangfeng

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 <jingxiangfeng@huawei.com>
---
 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 dd3a1f3dcc19..d2ef46337191 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.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] memstick: r592: Fix error return in r592_probe()
  2020-11-25  1:47 [PATCH] memstick: r592: Fix error return in r592_probe() Jing Xiangfeng
@ 2020-12-04 14:37 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2020-12-04 14:37 UTC (permalink / raw)
  To: Jing Xiangfeng
  Cc: Maxim Levitsky, Alex Dubov, Andrew Morton, linux-mmc,
	Linux Kernel Mailing List

On Wed, 25 Nov 2020 at 02:43, Jing Xiangfeng <jingxiangfeng@huawei.com> wrote:
>
> 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 <jingxiangfeng@huawei.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  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 dd3a1f3dcc19..d2ef46337191 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.22.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-04 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  1:47 [PATCH] memstick: r592: Fix error return in r592_probe() Jing Xiangfeng
2020-12-04 14:37 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).