lkml.org 
[lkml]   [2020]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 160/477] soundwire: slave: dont init debugfs on device registration error
    Date
    From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

    [ 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>
    ---
    drivers/soundwire/slave.c | 2 ++
    1 file changed, 2 insertions(+)

    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);

    --
    2.25.1


    \
     
     \ /
      Last update: 2020-06-23 23:39    [W:2.129 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site