summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2020-04-20 02:51:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:50:23 +0200
commitcbec16266a354db4d1c80d7f46883b73bb335c26 (patch)
treec5ed1a000cfe198891dbd06a42c387b0139c647a
parenta45fc52449d7a0686f31c079dc5f412b11d0f187 (diff)
downloadlinux-cbec16266a354db4d1c80d7f46883b73bb335c26.tar.gz
linux-cbec16266a354db4d1c80d7f46883b73bb335c26.tar.bz2
linux-cbec16266a354db4d1c80d7f46883b73bb335c26.zip
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 <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20200419185117.4233-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/soundwire/slave.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
index 6473fa602f82..611f4f5bc36a 100644
--- a/drivers/soundwire/slave.c
+++ b/drivers/soundwire/slave.c
@@ -57,6 +57,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);