lkml.org 
[lkml]   [2017]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 37/59] backlight: adp5520: Fix error handling in adp5520_bl_probe()
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Alexey Khoroshilov <khoroshilov@ispras.ru>


    [ Upstream commit 0eb3fba8c68275f0122f65f7316efaaf86448016 ]

    If adp5520_bl_setup() fails, sysfs group left unremoved.

    By the way, fix overcomplicated assignement of error code.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
    Acked-by: Michael Hennerich <michael.hennerich@analog.com>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/video/backlight/adp5520_bl.c | 12 ++++++++++--
    1 file changed, 10 insertions(+), 2 deletions(-)

    --- a/drivers/video/backlight/adp5520_bl.c
    +++ b/drivers/video/backlight/adp5520_bl.c
    @@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platf
    }

    platform_set_drvdata(pdev, bl);
    - ret |= adp5520_bl_setup(bl);
    + ret = adp5520_bl_setup(bl);
    + if (ret) {
    + dev_err(&pdev->dev, "failed to setup\n");
    + if (data->pdata->en_ambl_sens)
    + sysfs_remove_group(&bl->dev.kobj,
    + &adp5520_bl_attr_group);
    + return ret;
    + }
    +
    backlight_update_status(bl);

    - return ret;
    + return 0;
    }

    static int adp5520_bl_remove(struct platform_device *pdev)

    \
     
     \ /
      Last update: 2017-11-19 15:37    [W:4.388 / U:0.668 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site