netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/2] sh_eth: check platform data pointer
Date: Wed, 30 Oct 2013 22:55:13 +0300	[thread overview]
Message-ID: <52716421.9080807@cogentembedded.com> (raw)
In-Reply-To: <201308310423.30322.sergei.shtylyov@cogentembedded.com>

Hello.

On 08/31/2013 04:23 AM, Sergei Shtylyov wrote:

> Check the platform data pointer before dereferencing it and error out of the
> probe() method if it's NULL.

> This has additional effect of preventing kernel oops with outdated platform data
> containing zero PHY address instead (such as on SolutionEngine7710).

> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> ---
> This patch is against Dave's 'net-next.git' repo.

>   drivers/net/ethernet/renesas/sh_eth.c |    6 ++++++
>   1 file changed, 6 insertions(+)

> Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
> ===================================================================
> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c
> @@ -2653,6 +2653,12 @@ static int sh_eth_drv_probe(struct platf
>   	pm_runtime_enable(&pdev->dev);
>   	pm_runtime_resume(&pdev->dev);
>
> +	if (!pd) {
> +		dev_err(&pdev->dev, "no platform data\n");
> +		ret = -EINVAL;
> +		goto out_release;
> +	}
> +
>   	/* get PHY ID */
>   	mdp->phy_id = pd->phy;
>   	mdp->phy_interface = pd->phy_interface;

    David, could you please merge this patch? It has a value of its own, 
regardless of the device tree support in patch 2 (which got bloked).

WBR, Sergei

  parent reply	other threads:[~2013-10-30 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31  0:23 [PATCH 1/2] sh_eth: check platform data pointer Sergei Shtylyov
2013-09-04  6:48 ` Simon Horman
2013-10-30 19:55 ` Sergei Shtylyov [this message]
2013-10-30 19:16   ` David Miller

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=52716421.9080807@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=linux-sh@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nobuhiro.iwamatsu.yj@renesas.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;
as well as URLs for NNTP newsgroup(s).