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:	Mon, 06 Apr 2015 16:51:34 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	abrestic@...omium.org
Cc:	peppe.cavallaro@...com, netdev@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	govindraj.raja@...tec.com, james.hartley@...tec.com
Subject: Re: [PATCH 2/2] stmmac: Add IMG Pistachio platform glue layer

From: Andrew Bresticker <abrestic@...omium.org>
Date: Thu,  2 Apr 2015 16:46:36 -0700

> +static void *pistachio_dwmac_setup(struct platform_device *pdev)
> +{
> +	struct pistachio_dwmac_priv_data *pdata;
> +
> +	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
> +	if (!pdata)
> +		return ERR_PTR(-ENOMEM);
> +
> +	pdata->sys_clk = devm_clk_get(&pdev->dev, "sys");
> +	if (IS_ERR(pdata->sys_clk)) {
> +		dev_err(&pdev->dev, "Failed to get sys clock: %ld\n",
> +			PTR_ERR(pdata->sys_clk));
> +		return pdata->sys_clk;

Please do not store potential error pointers in dynamically allocated
memory.

Put it in a local variable for the devm_clk_get() call, then if it
succeeds and is not an error pointer, place it into pdata->sys_clk.

You must resubmit this entire patch series when updating any aspect
of it.  I'm pre-emptively telling you this because often people think
they can just post a new version of the fixed patch, but that's not
how things work here :-)

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ