From: "Levin, Alexander (Sasha Levin)" <alexander.levin@one.verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
Lee Jones <lee.jones@linaro.org>,
"Levin,
Alexander (Sasha Levin)" <alexander.levin@one.verizon.com>
Subject: [PATCH AUTOSEL for-4.9 34/53] backlight: adp5520: Fix error handling in adp5520_bl_probe()
Date: Wed, 8 Nov 2017 20:50:03 +0000 [thread overview]
Message-ID: <20171108204940.27321-34-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171108204940.27321-1-alexander.levin@verizon.com>
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>
---
drivers/video/backlight/adp5520_bl.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c
index dd88ba1d71ce..35373e2065b2 100644
--- a/drivers/video/backlight/adp5520_bl.c
+++ b/drivers/video/backlight/adp5520_bl.c
@@ -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);
+ return ret;
+ }
+
backlight_update_status(bl);
- return ret;
+ return 0;
}
static int adp5520_bl_remove(struct platform_device *pdev)
--
2.11.0
next prev parent reply other threads:[~2017-11-08 21:03 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 20:49 [PATCH AUTOSEL for-4.9 01/53] extcon: Remove potential problem when calling extcon_register_notifier() Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 03/53] fm10k: request reset when mbx->state changes Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 02/53] extcon: palmas: Check the parent instance to prevent the NULL Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 05/53] ARM: dts: Fix compatible for ti81xx uarts for 8250 Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 04/53] spi: imx: adjust watermark level according to transfer length Levin, Alexander (Sasha Levin)
2017-11-08 20:57 ` Mark Brown
2017-11-08 21:39 ` Levin, Alexander (Sasha Levin)
2017-11-08 22:11 ` Mark Brown
2017-11-08 22:48 ` Levin, Alexander (Sasha Levin)
2017-11-08 23:11 ` Mark Brown
2017-11-09 0:00 ` Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 06/53] ARM: dts: Fix am335x and dm814x scm syscon to probe children Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 08/53] ARM: dts: Fix omap3 off mode pull defines Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 09/53] ARM: dts: omap5-uevm: Allow bootloader to configure USB Ethernet MAC Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 07/53] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 10/53] ata: ATA_BMDMA should depend on HAS_DMA Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 11/53] ata: SATA_HIGHBANK " Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 12/53] ata: SATA_MV " Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 16/53] igb: Fix hw_dbg logging in igb_update_flash_i210 Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 15/53] igb: close/suspend race in netif_device_detach Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 14/53] igb: reset the PHY before reading the PHY ID Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 13/53] drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 17/53] scsi: ufs-qcom: Fix module autoload Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 20/53] staging: rtl8188eu: fix incorrect ERROR tags from logs Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 18/53] scsi: ufs: add capability to keep auto bkops always enabled Levin, Alexander (Sasha Levin)
2017-11-08 20:49 ` [PATCH AUTOSEL for-4.9 19/53] tcp: provide timestamps for partial writes Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 24/53] scsi: lpfc: Correct host name in symbolic_name field Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 23/53] scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 22/53] scsi: lpfc: Add missing memory barrier Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 21/53] x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 27/53] rtc: rx8010: change lock mechanism Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 26/53] scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 25/53] scsi: lpfc: Correct issue leading to oops during link reset Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 28/53] power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 32/53] drm/omap: panel-sony-acx565akm.c: Add MODULE_ALIAS Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 29/53] power: supply: axp288_fuel_gauge: Read 12 bit values 2 registers at a time Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 30/53] ALSA: vx: Don't try to update capture stream before running Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 31/53] ALSA: vx: Fix possible transfer overflow Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 36/53] ALSA: hda/realtek - Add new codec ID ALC299 Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 33/53] backlight: lcd: Fix race condition during register Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 35/53] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` Levin, Alexander (Sasha Levin) [this message]
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 40/53] ixgbe: handle close/suspend race with netif_device_detach/present Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 39/53] ixgbe: fix AER error handling Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 38/53] ixgbe: Configure advertised speeds correctly for KR/KX backplane Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 37/53] arm64: dts: NS2: reserve memory for Nitro firmware Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 42/53] ixgbe: Reduce I2C retry count on X550 devices Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 43/53] ixgbe: add mask for 64 RSS queues Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 41/53] ixgbe: Fix reporting of 100Mb capability Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 44/53] ixgbe: do not disable FEC from the driver Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 49/53] MIPS: init: Ensure bootmem does not corrupt reserved memory Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 45/53] staging: rtl8712: fixed little endian problem Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 47/53] staging: greybus: add host device function pointer checks Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 48/53] MIPS: End asm function prologue macros with .insn Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 46/53] staging: wilc1000: Fix endian sparse warning Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 52/53] MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 53/53] MIPS: Use Makefile.postlink to insert relocations into vmlinux Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 51/53] MIPS: traps: Ensure L1 & L2 ECC checking match for CM3 systems Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.9 50/53] MIPS: init: Ensure reserved memory regions are not added to bootmem Levin, Alexander (Sasha Levin)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171108204940.27321-34-alexander.levin@verizon.com \
--to=alexander.levin@one.verizon.com \
--cc=khoroshilov@ispras.ru \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®