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]
Message-ID: <f54947a6-8b9c-18d5-4e9b-d33d504131c6@codeaurora.org>
Date:   Wed, 27 Mar 2019 18:28:17 +0530
From:   Mukesh Ojha <mojha@...eaurora.org>
To:     Kangjie Lu <kjlu@....edu>
Cc:     pakki001@....edu, "Lad, Prabhakar" <prabhakar.csengg@...il.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: vpss: fix a potential NULL pointer dereference


On 3/23/2019 8:21 AM, Kangjie Lu wrote:
> In case ioremap fails, the fix returns -ENOMEM to avoid NULL
> pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>


Reviewed-by: Mukesh Ojha <mojha@...eaurora.org>

-Mukesh

> ---
>   drivers/media/platform/davinci/vpss.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c
> index 19cf6853411e..89a86c19579b 100644
> --- a/drivers/media/platform/davinci/vpss.c
> +++ b/drivers/media/platform/davinci/vpss.c
> @@ -518,6 +518,11 @@ static int __init vpss_init(void)
>   		return -EBUSY;
>   
>   	oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4);
> +	if (unlikely(!oper_cfg.vpss_regs_base2)) {
> +		release_mem_region(VPSS_CLK_CTRL, 4);
> +		return -ENOMEM;
> +	}
> +
>   	writel(VPSS_CLK_CTRL_VENCCLKEN |
>   		     VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ