The patch titled sysdev: detect multiple driver registrations has been removed from the -mm tree. Its filename was sysdev-detect-multiple-driver-registrations.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: sysdev: detect multiple driver registrations From: Ben Dooks <ben@xxxxxxxxx> I've just found how easy it is to accidentally register a sysdev_driver for two different classes. When this happens, bad things happen as the sysdev_driver structure keeps has the list entry for the driver registration. The following patch makes a WARN_ON() if this happens, although I think BUG_ON or returning -EAGAIN could also be valid responses to this. Signed-off-by: Ben Dooks <ben@xxxxxxxxx> Cc: Kay Sievers <kay.sievers@xxxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/base/sys.c | 5 +++++ 1 file changed, 5 insertions(+) diff -puN drivers/base/sys.c~sysdev-detect-multiple-driver-registrations drivers/base/sys.c --- a/drivers/base/sys.c~sysdev-detect-multiple-driver-registrations +++ a/drivers/base/sys.c @@ -171,6 +171,11 @@ int sysdev_driver_register(struct sysdev WARN_ON(drv->entry.next != drv->entry.prev); WARN_ON(drv->entry.next != NULL); + /* Check whether this driver has already been added to a class. */ + + WARN_ON(drv->entry.next != drv->entry.prev); + WARN_ON(drv->entry.next != NULL); + mutex_lock(&sysdev_drivers_lock); if (cls && kset_get(&cls->kset)) { list_add_tail(&drv->entry, &cls->drivers); _ Patches currently in -mm which might be from ben@xxxxxxxxx are -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html