linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: heiko@sntech.de
Cc: kuba@kernel.org, robh+dt@kernel.org, andrew@lunn.ch,
	f.fainelli@gmail.com, hkallweit1@gmail.com,
	linux@armlinux.org.uk, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	christoph.muellner@theobroma-systems.com,
	heiko.stuebner@theobroma-systems.com
Subject: Re: [PATCH v3 1/3] net: phy: mscc: move shared probe code into a helper
Date: Mon, 15 Jun 2020 18:11:29 -0700 (PDT)	[thread overview]
Message-ID: <20200615.181129.570239999533845176.davem@davemloft.net> (raw)
In-Reply-To: <20200615144501.1140870-1-heiko@sntech.de>

From: Heiko Stuebner <heiko@sntech.de>
Date: Mon, 15 Jun 2020 16:44:59 +0200

>  static int vsc8584_probe(struct phy_device *phydev)
>  {
>  	struct vsc8531_private *vsc8531;
> +	int rc;
>  	u32 default_mode[4] = {VSC8531_LINK_1000_ACTIVITY,
>  	   VSC8531_LINK_100_ACTIVITY, VSC8531_LINK_ACTIVITY,
>  	   VSC8531_DUPLEX_COLLISION};
> @@ -2005,32 +2015,24 @@ static int vsc8584_probe(struct phy_device *phydev)
>  		return -ENOTSUPP;
>  	}
>  
> -	vsc8531 = devm_kzalloc(&phydev->mdio.dev, sizeof(*vsc8531), GFP_KERNEL);
> -	if (!vsc8531)
> -		return -ENOMEM;

Because you removed this devm_kzalloc() code, vsc8531 is never initialized.

> +	return devm_phy_package_join(&phydev->mdio.dev, phydev,
> +				     vsc8531->base_addr, 0);

But it is still dereferenced here.

Did the compiler really not warn you about this when you test built
these changes?

  parent reply	other threads:[~2020-06-16  1:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 14:44 [PATCH v3 1/3] net: phy: mscc: move shared probe code into a helper Heiko Stuebner
2020-06-15 14:45 ` [PATCH v3 2/3] dt-bindings: net: ethernet-phy: add enet-phy-clock-out-frequency Heiko Stuebner
2020-06-15 14:45 ` [PATCH v3 3/3] net: phy: mscc: handle the clkout control on some phy variants Heiko Stuebner
2020-06-15 20:56 ` [PATCH v3 1/3] net: phy: mscc: move shared probe code into a helper kernel test robot
2020-06-16  1:11 ` David Miller [this message]
2020-06-16  1:12   ` David Miller
2020-06-16  9:10     ` Heiko Stübner
2020-06-16 10:13       ` Russell King - ARM Linux admin
2020-06-16 12:27 ` [kbuild] " Dan Carpenter

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=20200615.181129.570239999533845176.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=christoph.muellner@theobroma-systems.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=heiko.stuebner@theobroma-systems.com \
    --cc=heiko@sntech.de \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@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).