[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171018054926.4756-1-jeffy.chen@rock-chips.com>
Date: Wed, 18 Oct 2017 13:49:26 +0800
From: Jeffy Chen <jeffy.chen@...k-chips.com>
To: linux-kernel@...r.kernel.org
Cc: dmitry.torokhov@...il.com, heiko@...ech.de,
briannorris@...omium.org, rjw@...ysocki.net, dianders@...omium.org,
tfiga@...omium.org, broonie@...nel.org, seanpaul@...omium.org,
thierry.reding@...il.com, Jeffy Chen <jeffy.chen@...k-chips.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH] driver core: Make sure device detached from driver before deleting it
There are cases we call device_del() without detaching it from the
driver(e.g. spi core del children devices).
Signed-off-by: Jeffy Chen <jeffy.chen@...k-chips.com>
---
drivers/base/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 12ebd055724c..717efc3020af 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1951,6 +1951,8 @@ void device_del(struct device *dev)
struct kobject *glue_dir = NULL;
struct class_interface *class_intf;
+ device_release_driver(dev);
+
/* Notify clients of device removal. This call must come
* before dpm_sysfs_remove().
*/
--
2.11.0
Powered by blists - more mailing lists