lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 9 Jun 2013 19:07:52 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	Wei Yongjun <weiyj.lk@...il.com>
Cc:	maximlevitsky@...il.com, yongjun_wei@...ndmicro.com.cn,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] memstick: fix error return code in r592_probe()

It's better to combine with moving it to pcim_* and devm_* and get
minus-diff instead of plus.

On Fri, Jun 7, 2013 at 5:15 AM, Wei Yongjun <weiyj.lk@...il.com> wrote:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> ---
>  drivers/memstick/host/r592.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c
> index 1b6e913..aa1dd24 100644
> --- a/drivers/memstick/host/r592.c
> +++ b/drivers/memstick/host/r592.c
> @@ -761,8 +761,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);
> @@ -789,12 +791,13 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>                 &dev->dummy_dma_page_physical_address);
>         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");
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ