mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: abrestic@chromium.org
Cc: peppe.cavallaro@st.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	govindraj.raja@imgtec.com, james.hartley@imgtec.com
Subject: Re: [PATCH 2/2] stmmac: Add IMG Pistachio platform glue layer
Date: Mon, 06 Apr 2015 16:51:34 -0400 (EDT)	[thread overview]
Message-ID: <20150406.165134.2223739588886155438.davem@davemloft.net> (raw)
In-Reply-To: <1428018396-11270-2-git-send-email-abrestic@chromium.org>

From: Andrew Bresticker <abrestic@chromium.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.

      reply	other threads:[~2015-04-06 20:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 23:46 [PATCH 1/2] stmmac: Add binding document for IMG Pistachio DWMAC Andrew Bresticker
2015-04-02 23:46 ` [PATCH 2/2] stmmac: Add IMG Pistachio platform glue layer Andrew Bresticker
2015-04-06 20:51   ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150406.165134.2223739588886155438.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=abrestic@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=govindraj.raja@imgtec.com \
    --cc=james.hartley@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®