From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] net: mv643xx_eth: potential NULL dereference in probe()
Date: Wed, 13 Nov 2013 09:24:20 +0100 [thread overview]
Message-ID: <52833734.5000507@gmail.com> (raw)
In-Reply-To: <20131113075247.GI25541@elgon.mountain>
On 11/13/13 08:52, Dan Carpenter wrote:
> We assume that "mp->phy" can be NULL a couple lines before the
> dereference.
>
> Fixes: 1cce16d37d0f ('net: mv643xx_eth: Add missing phy_addr_set in DT mode')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 00cd36e..e7905d9 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2890,7 +2890,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
> PHY_INTERFACE_MODE_GMII);
> if (!mp->phy)
> err = -ENODEV;
> - phy_addr_set(mp, mp->phy->addr);
> + else
> + phy_addr_set(mp, mp->phy->addr);
> } else if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
> mp->phy = phy_scan(mp, pd->phy_addr);
>
>
next prev parent reply other threads:[~2013-11-13 8:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 7:52 [patch] net: mv643xx_eth: potential NULL dereference in probe() Dan Carpenter
2013-11-13 8:24 ` Sebastian Hesselbarth [this message]
2013-11-13 18:00 ` Jason Gunthorpe
2013-11-14 8:12 ` 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=52833734.5000507@gmail.com \
--to=sebastian.hesselbarth@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).