[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190118.110814.2046519039828393505.davem@davemloft.net>
Date: Fri, 18 Jan 2019 11:08:14 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: thomas.petazzoni@...tlin.com
Cc: andrew@...n.ch, f.fainelli@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, paul.kocialkowski@...tlin.com
Subject: Re: [PATCH] net: phy: mdio_bus: add missing device_del() in
mdiobus_register() error handling
From: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Date: Wed, 16 Jan 2019 10:53:58 +0100
> The current code in __mdiobus_register() doesn't properly handle
> failures returned by the devm_gpiod_get_optional() call: it returns
> immediately, without unregistering the device that was added by the
> call to device_register() earlier in the function.
>
> This leaves a stale device, which then causes a NULL pointer
> dereference in the code that handles deferred probing:
...
> The actual error that we had from devm_gpiod_get_optional() was
> -EPROBE_DEFER, due to the GPIO being provided by a driver that is
> probed later than the Ethernet controller driver.
>
> To fix this, we simply add the missing device_del() invocation in the
> error path.
>
> Fixes: 69226896ad636 ("mdio_bus: Issue GPIO RESET to PHYs")
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Applied and queued up for -stable.
Powered by blists - more mailing lists