linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Levin,
	Alexander (Sasha Levin)" <alexander.levin@one.verizon.com>
Subject: [PATCH AUTOSEL for-4.4 24/39] backlight: lcd: Fix race condition during register
Date: Wed, 8 Nov 2017 20:50:39 +0000	[thread overview]
Message-ID: <20171108205027.27525-24-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171108205027.27525-1-alexander.levin@verizon.com>

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

[ Upstream commit cc21942bce652d1a92dae85b785378256e1df1f7 ]

Once device_register is called for a device its attributes might be
accessed. As the callbacks of a lcd device's attributes make use of the
lcd_ops, the respective member must be setup before calling
device_register.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/video/backlight/lcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 7de847df224f..4b40c6a4d441 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -226,6 +226,8 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent,
 	dev_set_name(&new_ld->dev, "%s", name);
 	dev_set_drvdata(&new_ld->dev, devdata);
 
+	new_ld->ops = ops;
+
 	rc = device_register(&new_ld->dev);
 	if (rc) {
 		put_device(&new_ld->dev);
@@ -238,8 +240,6 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent,
 		return ERR_PTR(rc);
 	}
 
-	new_ld->ops = ops;
-
 	return new_ld;
 }
 EXPORT_SYMBOL(lcd_device_register);
-- 
2.11.0

  parent reply	other threads:[~2017-11-08 21:25 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 20:50 [PATCH AUTOSEL for-4.4 01/39] extcon: palmas: Check the parent instance to prevent the NULL Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 03/39] ARM: dts: Fix compatible for ti81xx uarts for 8250 Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 02/39] fm10k: request reset when mbx->state changes Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 04/39] ARM: dts: Fix am335x and dm814x scm syscon to probe children Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 05/39] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 09/39] ata: SATA_MV should depend on HAS_DMA Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 06/39] ARM: dts: Fix omap3 off mode pull defines Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 07/39] ata: ATA_BMDMA should depend on HAS_DMA Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 08/39] ata: SATA_HIGHBANK " Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 13/39] igb: Fix hw_dbg logging in igb_update_flash_i210 Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 10/39] drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 11/39] igb: reset the PHY before reading the PHY ID Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 12/39] igb: close/suspend race in netif_device_detach Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 15/39] scsi: ufs: add capability to keep auto bkops always enabled Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 17/39] scsi: lpfc: Add missing memory barrier Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 16/39] staging: rtl8188eu: fix incorrect ERROR tags from logs Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 14/39] scsi: ufs-qcom: Fix module autoload Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 21/39] scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 20/39] scsi: lpfc: Correct issue leading to oops during link reset Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 18/39] 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.4 19/39] scsi: lpfc: Correct host name in symbolic_name field Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 25/39] backlight: adp5520: Fix error handling in adp5520_bl_probe() Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 22/39] ALSA: vx: Don't try to update capture stream before running Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` Levin, Alexander (Sasha Levin) [this message]
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 23/39] ALSA: vx: Fix possible transfer overflow Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 28/39] arm64: dts: NS2: reserve memory for Nitro firmware Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 26/39] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 29/39] ixgbe: fix AER error handling Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 27/39] ALSA: hda/realtek - Add new codec ID ALC299 Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 32/39] ixgbe: add mask for 64 RSS queues Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 33/39] ixgbe: do not disable FEC from the driver Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 30/39] ixgbe: handle close/suspend race with netif_device_detach/present Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 31/39] ixgbe: Reduce I2C retry count on X550 devices Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 34/39] staging: rtl8712: fixed little endian problem Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 35/39] MIPS: End asm function prologue macros with .insn Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 36/39] MIPS: init: Ensure bootmem does not corrupt reserved memory Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 37/39] MIPS: init: Ensure reserved memory regions are not added to bootmem Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 39/39] MIPS: Use Makefile.postlink to insert relocations into vmlinux Levin, Alexander (Sasha Levin)
2017-11-09  9:16   ` Matt Redfearn
2017-11-09 16:42     ` Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-4.4 38/39] MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds 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=20171108205027.27525-24-alexander.levin@verizon.com \
    --to=alexander.levin@one.verizon.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).