lkml.org 
[lkml]   [2013]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [PATCH] mwifiex: don't return zero on failure paths in mwifiex_pcie_init()
Hi Alexey,

Thanks for the patch.

> If pci_iomap() fails in mwifiex_pcie_init(), it breaks off initialization,
> deallocates all resources, but returns zero.
> The patch adds -EIO as return value in this case.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Acked-by: Bing Zhao <bzhao@marvell.com>

Thanks,
Bing

> ---
> drivers/net/wireless/mwifiex/pcie.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index 13fbc4e..9d9349c 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -1739,6 +1739,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
> card->pci_mmap = pci_iomap(pdev, 0, 0);
> if (!card->pci_mmap) {
> dev_err(adapter->dev, "iomap(0) error\n");
> + ret = -EIO;
> goto err_iomap0;
> }
> ret = pci_request_region(pdev, 2, DRV_NAME);
> @@ -1749,6 +1750,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
> card->pci_mmap1 = pci_iomap(pdev, 2, 0);
> if (!card->pci_mmap1) {
> dev_err(adapter->dev, "iomap(2) error\n");
> + ret = -EIO;
> goto err_iomap2;
> }
>
> --
> 1.7.9.5



\
 
 \ /
  Last update: 2013-01-25 22:42    [W:0.034 / U:3.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site