mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>, barebox@lists.infradead.org
Subject: Re: [PATCH] ARM: zii-commmon: Fix NULL pointer dereference in do_rdu1_switch_reset()
Date: Wed, 30 Oct 2019 18:08:27 +0100	[thread overview]
Message-ID: <c77a628a5dd966772a21e8a634e9aa9f3bc35662.camel@pengutronix.de> (raw)
In-Reply-To: <20191030165321.6779-1-andrew.smirnov@gmail.com>

On Mi, 2019-10-30 at 09:53 -0700, Andrey Smirnov wrote:
> We need to go to parent's private data to get a pointer to struct
> rave_sp. Fix that.
> 
> Fixes: 493e2ee38f ("ARM: zii-common: add support for switch reset on RDU1")
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>

Urgh, I remember that I fixed the very same bug some time ago. Seems I
lost that fixup before upstreaming...

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  arch/arm/boards/zii-common/switch-cmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boards/zii-common/switch-cmd.c b/arch/arm/boards/zii-common/switch-cmd.c
> index 30438053a1..2b9c34bfac 100644
> --- a/arch/arm/boards/zii-common/switch-cmd.c
> +++ b/arch/arm/boards/zii-common/switch-cmd.c
> @@ -42,7 +42,7 @@ static int do_rdu2_switch_reset(void)
>  static int do_rdu1_switch_reset(void)
>  {
>  	struct device_d *sp_dev = get_device_by_name("sp");
> -	struct rave_sp *sp = sp_dev->priv;
> +	struct rave_sp *sp = sp_dev->parent->priv;
>  	u8 cmd[] = {
>  		[0] = RAVE_SP_CMD_RESET_ETH_SWITCH,
>  		[1] = 0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-10-30 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 16:53 Andrey Smirnov
2019-10-30 17:08 ` Lucas Stach [this message]
2019-11-04  8:13 ` Sascha Hauer

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=c77a628a5dd966772a21e8a634e9aa9f3bc35662.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /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