phylib: fix premature freeing of struct mii_bus
Commit 46abc021 ("phylib: give mdio buses a device tree presence") added a call to device_unregister() in a situation where the caller did not intend for the device to be freed yet, but apart from just unregistering the device from the system, device_unregister() does an additional put_device() that is intended to free it. The right function to use in this situation is device_del(), which unregisters the device from the system like device_unregister() does, but without dropping the reference count an additional time. Bug report from Bryan Wu <cooloney@kernel.org>. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Tested-by: NBryan Wu <cooloney@kernel.org> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
Showing
想要评论请 注册 或 登录