Skip to content

Commit

Permalink
memstick: r592: Fix error return in r592_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit db29d3d ]

Fix to return a error code from the error handling case instead of 0.

Fixes: 9263412 ("memstick: add driver for Ricoh R5C592 card reader")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Link: https://lore.kernel.org/r/20201125014718.153563-1-jingxiangfeng@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
hiss2018 authored and gregkh committed Dec 30, 2020
1 parent 28cb1d6 commit db4a900
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/memstick/host/r592.c
Expand Up @@ -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);
Expand All @@ -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");
Expand Down

0 comments on commit db4a900

Please sign in to comment.