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:   Mon, 11 Mar 2019 13:37:10 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     kjlu@....edu
Cc:     pakki001@....edu, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: fujitsu: fix a potential NULL pointer dereference

From: Kangjie Lu <kjlu@....edu>
Date: Mon, 11 Mar 2019 01:15:01 -0500

> In case ioremap fails, the fix returns -ENOMEM to avoid the
> NULL pointer dereference.
> 
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
>  drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
> index a69cd19a55ae..5061ddf699a7 100644
> --- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
> +++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
> @@ -547,6 +547,9 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
>  	return -1;
>  
>      base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
> +    if (!base)
> +	    return -ENOMEM;
> +

You must release the pcmcia window if you exit the function here.

Powered by blists - more mailing lists