From: Pierre-Louis Bossart Date: Sun, 19 Apr 2020 18:51:15 +0000 (+0800) Subject: soundwire: slave: don't init debugfs on device registration error X-Git-Tag: v5.7.6~317 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=51cfd876ddb0ccc2645f0f35c91a7dfe314dd760;p=users%2Fdwmw2%2Flinux.git soundwire: slave: don't init debugfs on device registration error [ Upstream commit 8893ab5e8ee5d7c12e0fc1dca4a309475064473d ] The error handling flow seems incorrect, there is no reason to try and add debugfs support if the device registration did not succeed. Return on error. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200419185117.4233-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c index aace57fae7f83..4bacdb187eab8 100644 --- a/drivers/soundwire/slave.c +++ b/drivers/soundwire/slave.c @@ -68,6 +68,8 @@ static int sdw_slave_add(struct sdw_bus *bus, list_del(&slave->node); mutex_unlock(&bus->bus_lock); put_device(&slave->dev); + + return ret; } sdw_slave_debugfs_init(slave);