public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel•com>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai•org>,
	<netdev@vger•kernel.org>, David Miller <davem@davemloft•net>
Subject: Re: [PATCH] net/at91_ether: avoid NULL pointer dereference
Date: Mon, 7 Apr 2014 09:06:54 +0200	[thread overview]
Message-ID: <53424E8E.6030908@atmel.com> (raw)
In-Reply-To: <1396809464-22471-1-git-send-email-gilles.chanteperdrix@xenomai.org>

On 06/04/2014 20:37, Gilles Chanteperdrix :
> The at91_ether driver calls macb_mii_init passing a 'struct macb'
> structure whose tx_clk member is initialized to 0. However,
> macb_handle_link_change() expects tx_clk to be the result of
> a call to clk_get, and so IS_ERR(tx_clk) to be true if the clock
> is invalid. This causes an oops when booting Linux 3.14 on the
> csb637 board. The following changes avoids this.
> 
> Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai•org>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel•com>

Thanks for this fix. Bye,

> ---
>  drivers/net/ethernet/cadence/at91_ether.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> index ce75de9..4a79eda 100644
> --- a/drivers/net/ethernet/cadence/at91_ether.c
> +++ b/drivers/net/ethernet/cadence/at91_ether.c
> @@ -342,6 +342,9 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  	}
>  	clk_enable(lp->pclk);
>  
> +	lp->hclk = ERR_PTR(-ENOENT);
> +	lp->tx_clk = ERR_PTR(-ENOENT);
> +
>  	/* Install the interrupt handler */
>  	dev->irq = platform_get_irq(pdev, 0);
>  	res = devm_request_irq(&pdev->dev, dev->irq, at91ether_interrupt, 0, dev->name, dev);
> 


-- 
Nicolas Ferre

  reply	other threads:[~2014-04-07  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 18:37 [PATCH] net/at91_ether: avoid NULL pointer dereference Gilles Chanteperdrix
2014-04-07  7:06 ` Nicolas Ferre [this message]
2014-04-07 19:10 ` 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=53424E8E.6030908@atmel.com \
    --to=nicolas.ferre@atmel$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=gilles.chanteperdrix@xenomai$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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