From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [PATCH] net: ravb: Fix NULL pointer access
Date: Tue, 15 Sep 2020 16:23:55 +0200 [thread overview]
Message-ID: <95fb3cfe-e219-a34a-b2f4-5120ea356842@xilinx.com> (raw)
In-Reply-To: <20200915141038.3371-1-biju.das.jz@bp.renesas.com>
On 15. 09. 20 16:10, Biju Das wrote:
> Some phy's like rtl8211e do not support writeext() callback. Add a check to
> avoid null pointer access before calling writeext() callback.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> drivers/net/ravb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
> index 886f53ee82..623d377897 100644
> --- a/drivers/net/ravb.c
> +++ b/drivers/net/ravb.c
> @@ -438,7 +438,8 @@ static int ravb_config(struct udevice *dev)
>
> writel(mask, eth->iobase + RAVB_REG_ECMR);
>
> - phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19);
> + if (phy->drv->writeext)
> + phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19);
>
> return 0;
> }
>
Make sense.
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
next prev parent reply other threads:[~2020-09-15 14:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 14:10 [PATCH] net: ravb: Fix NULL pointer access Biju Das
2020-09-15 14:23 ` Michal Simek [this message]
2020-09-16 13:53 ` Marek Vasut
2020-09-16 15:43 ` Biju Das
2020-09-16 21:30 ` Marek Vasut
2020-09-18 15:26 ` Biju Das
2020-09-19 2:48 ` Marek Vasut
2020-09-19 11:14 ` Biju Das
2020-09-19 12:44 ` Marek Vasut
2020-09-19 18:14 ` Biju Das
2020-09-19 19:12 ` Marek Vasut
2020-09-20 7:34 ` Biju Das
2020-09-21 16:26 ` Marek Vasut
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=95fb3cfe-e219-a34a-b2f4-5120ea356842@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=u-boot@lists.denx.de \
/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