From db07e1b74dc42d8670c8ced10ba992ea3fb342b2 Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Mon, 12 May 2014 10:10:50 -0400 Subject: [PATCH] xpp: stability -- deadlock in waitfor_xpds() waitfor_xpds xbus sysfs file should not take an xbus refcount: * It is called from sysfs which maintain its own device refcount. * If put_xbus() calls xbus_destroy() than down the call chain it will try to release an object that is held by sysfs. * This will create a deadlock. Signed-off-by: Tzafrir Cohen --- drivers/dahdi/xpp/xbus-core.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c index 5671618..e9c6722 100644 --- a/drivers/dahdi/xpp/xbus-core.c +++ b/drivers/dahdi/xpp/xbus-core.c @@ -1640,10 +1640,6 @@ int waitfor_xpds(xbus_t *xbus, char *buf) * FIXME: worker is created before ????? * So by now it exists and initialized. */ - /* until end of waitfor_xpds_show(): */ - xbus = get_xbus(__func__, xbus->num); - if (!xbus) - return -ENODEV; worker = &xbus->worker; BUG_ON(!worker); if (!worker->wq) { @@ -1682,7 +1678,6 @@ int waitfor_xpds(xbus_t *xbus, char *buf) spin_unlock_irqrestore(&xbus->lock, flags); } out: - put_xbus(__func__, xbus); /* from start of waitfor_xpds_show() */ return len; }