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 <redacted>
---
drivers/video/backlight/adp5520_bl.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
From: Michael Hennerich <michael.hennerich@analog.com> Date: 2016-07-11 11:00:44
On 09.07.2016 00:19, Alexey Khoroshilov wrote:
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 <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
@@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platform_device *pdev)}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);+returnret;+}+backlight_update_status(bl);-returnret;+return0;}staticintadp5520_bl_remove(structplatform_device*pdev)
--
Greetings,
Michael
--
Analog Devices GmbH Otl-Aicher Strasse 60-64 80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne
From: Lee Jones <hidden> Date: 2016-08-05 13:28:23
On Sat, 09 Jul 2016, Alexey Khoroshilov wrote:
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 <redacted>
---
drivers/video/backlight/adp5520_bl.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)