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]
Date:   Wed, 27 Mar 2019 19:12:29 +0530
From:   Mukesh Ojha <mojha@...eaurora.org>
To:     Kangjie Lu <kjlu@....edu>
Cc:     pakki001@....edu, Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Jose Abreu <joabreu@...opsys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: fix a potential NULL pointer dereference


On 3/12/2019 1:02 PM, Kangjie Lu wrote:
> In case of_device_get_match_data fails, the fix return -ENOMEM

s/-ENOMEM/-EINVAL


Otherwise looks good to me.
Make the above correction.
Reviewed-by: Mukesh Ojha <mojha@...eaurora.org>

-Mukesh

> to avoid the NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
>   drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> index 3256e5cbad27..344ead5949b1 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> @@ -485,6 +485,8 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)
>   	int err;
>   
>   	data = of_device_get_match_data(&pdev->dev);
> +	if (!data)
> +		return -EINVAL;
>   
>   	err = stmmac_dvr_remove(&pdev->dev);
>   	if (err < 0)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ