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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH-L+nNdVO4xYxcE0jg6uE8gzA2hCE=9UEz_0n7+BfNvsW9SdA@mail.gmail.com>
Date: Thu, 15 Jun 2023 09:10:30 +0530
From: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@...adcom.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc: kuba@...nel.org, vburru@...vell.com, aayarekar@...vell.com, 
	davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com, 
	sburla@...vell.com, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] octeon_ep: Add missing check for ioremap

On Thu, Jun 15, 2023 at 9:04 AM Jiasheng Jiang <jiasheng@...as.ac.cn> wrote:

> Add check for ioremap() and return the error if it fails in order to
> guarantee the success of ioremap().
>
> Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device
> initialization")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@...adcom.com>

> ---
> Changelog:
>
> v1-> v2:
>
> 1. Rewrite the error handling.
> ---
>  drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> index e1853da280f9..43eb6e871351 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> @@ -981,6 +981,9 @@ int octep_device_setup(struct octep_device *oct)
>                 oct->mmio[i].hw_addr =
>                         ioremap(pci_resource_start(oct->pdev, i * 2),
>                                 pci_resource_len(oct->pdev, i * 2));
> +               if (!oct->mmio[i].hw_addr)
> +                       goto unmap_prev;
> +
>                 oct->mmio[i].mapped = 1;
>         }
>
> @@ -1015,7 +1018,9 @@ int octep_device_setup(struct octep_device *oct)
>         return 0;
>
>  unsupported_dev:
> -       for (i = 0; i < OCTEP_MMIO_REGIONS; i++)
> +       i = OCTEP_MMIO_REGIONS;
> +unmap_prev:
> +       while (i--)
>                 iounmap(oct->mmio[i].hw_addr);
>
>         kfree(oct->conf);
> --
> 2.25.1
>
>
>

-- 
Regards,
Kalesh A P

Content of type "text/html" skipped

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4239 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ