lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 1/3] net: phy: mscc: move shared probe code into a helper
From
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?

\
 
 \ /
  Last update: 2020-06-16 03:12    [W:0.073 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site