Skip to contentSkip to conversation

Patch "backlight: adp5520: Fix error handling in adp5520_bl_probe()" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Nov 19, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

backlight: adp5520: Fix error handling in adp5520_bl_probe()

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:

     backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch

and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Sun Nov 19 12:16:40 CET 2017

From: Alexey Khoroshilov <[email protected]>
Date: Sat, 9 Jul 2016 01:19:51 +0300
Subject: backlight: adp5520: Fix error handling in adp5520_bl_probe()

From: Alexey Khoroshilov <[email protected]>

[ 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).

---
 drivers/video/backlight/adp5520_bl.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/video/backlight/adp5520_bl.c +10 -2
@@ -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)

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch