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]
Date:   Fri, 27 Oct 2017 19:19:25 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc:     Alessandro Zummo <a.zummo@...ertech.it>,
        "x86@...nel.org" <x86@...nel.org>,
        Wim Van Sebroeck <wim@...ana.be>,
        Ingo Molnar <mingo@...hat.com>,
        Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        Zha Qipeng <qipeng.zha@...el.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "dvhart@...radead.org" <dvhart@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Lee Jones <lee.jones@...aro.org>,
        Andy Shevchenko <andy@...radead.org>,
        Souvik Kumar Chakravarty <souvik.k.chakravarty@...el.com>,
        linux-rtc@...r.kernel.org, linux-watchdog@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        Sathyanarayanan Kuppuswamy Natarajan <sathyaosid@...il.com>
Subject: Re: [RFC v6 3/9] platform/x86: intel_punit_ipc: Fix resource ioremap warning

On Thu, Oct 19, 2017 at 3:23 AM,
<sathyanarayanan.kuppuswamy@...ux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
>
> For PUNIT device, ISPDRIVER_IPC and GTDDRIVER_IPC resources are
> not mandatory. So when PMC IPC driver creates a PUNIT device, if
> these resources are not available then it creates dummy resource
> entries for these missing resources. But during PUNIT device probe
> , doing ioremap on these dummy resources generates following warning
> messages.

Applied for my review and testing queue, thanks!

>
> intel_punit_ipc intel_punit_ipc: can't request region for resource [mem
> 0x00000000]
> intel_punit_ipc intel_punit_ipc: can't request region for resource [mem
> 0x00000000]
> intel_punit_ipc intel_punit_ipc: can't request region for resource [mem
> 0x00000000]
> intel_punit_ipc intel_punit_ipc: can't request region for resource [mem
> 0x00000000]
>
> This patch fixes this issue by adding extra check for resource size
> before performing ioremap operation.
>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
> ---
>  drivers/platform/x86/intel_punit_ipc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Changes since v5:
>  * None
>
> Changes since v4:
>  * None
>
> diff --git a/drivers/platform/x86/intel_punit_ipc.c b/drivers/platform/x86/intel_punit_ipc.c
> index a47a41f..b5b8901 100644
> --- a/drivers/platform/x86/intel_punit_ipc.c
> +++ b/drivers/platform/x86/intel_punit_ipc.c
> @@ -252,28 +252,28 @@ static int intel_punit_get_bars(struct platform_device *pdev)
>          * - GTDRIVER_IPC BASE_IFACE
>          */
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr;
>         }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr;
>         }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr;
>         }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 5);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr;
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ