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: Roger Quadros <rogerq@ti.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
"Levin,
Alexander (Sasha Levin)" <alexander.levin@one.verizon.com>
Subject: [PATCH AUTOSEL for-3.18 01/27] extcon: palmas: Check the parent instance to prevent the NULL
Date: Wed, 8 Nov 2017 20:50:55 +0000 [thread overview]
Message-ID: <20171108205049.27612-1-alexander.levin@verizon.com> (raw)
From: Roger Quadros <rogerq@ti.com>
[ Upstream commit 9fe172b9be532acc23e35ba693700383ab775e66 ]
extcon-palmas must be child of palmas and expects parent's
drvdata to be valid. Check for non NULL parent drvdata and
fail if it is NULL. Not doing so will result in a NULL
pointer dereference later in the probe() parent drvdata
is NULL (e.g. misplaced extcon-palmas node in device tree).
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
drivers/extcon/extcon-palmas.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
index 230e1220ce48..1cee9f4909db 100644
--- a/drivers/extcon/extcon-palmas.c
+++ b/drivers/extcon/extcon-palmas.c
@@ -150,6 +150,11 @@ static int palmas_usb_probe(struct platform_device *pdev)
struct palmas_usb *palmas_usb;
int status;
+ if (!palmas) {
+ dev_err(&pdev->dev, "failed to get valid parent\n");
+ return -EINVAL;
+ }
+
palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL);
if (!palmas_usb)
return -ENOMEM;
--
2.11.0
next reply other threads:[~2017-11-08 21:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 20:50 Levin, Alexander (Sasha Levin) [this message]
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 03/27] ARM: dts: Fix omap3 off mode pull defines Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 02/27] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 04/27] ata: ATA_BMDMA should depend on HAS_DMA Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 07/27] drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 05/27] ata: SATA_HIGHBANK should depend on HAS_DMA Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 08/27] igb: reset the PHY before reading the PHY ID Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 06/27] ata: SATA_MV should depend on HAS_DMA Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 09/27] igb: close/suspend race in netif_device_detach Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 12/27] scsi: lpfc: Add missing memory barrier Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 10/27] igb: Fix hw_dbg logging in igb_update_flash_i210 Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 11/27] staging: rtl8188eu: fix incorrect ERROR tags from logs Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 15/27] scsi: lpfc: Correct issue leading to oops during link reset Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 14/27] scsi: lpfc: Correct host name in symbolic_name field Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 16/27] ALSA: vx: Don't try to update capture stream before running Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 13/27] scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 18/27] backlight: lcd: Fix race condition during register Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 19/27] backlight: adp5520: Fix error handling in adp5520_bl_probe() Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 17/27] ALSA: vx: Fix possible transfer overflow Levin, Alexander (Sasha Levin)
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 20/27] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 22/27] ixgbe: handle close/suspend race with netif_device_detach/present Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 21/27] ixgbe: fix AER error handling Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 23/27] MIPS: End asm function prologue macros with .insn Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 24/27] MIPS: init: Ensure bootmem does not corrupt reserved memory Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 25/27] MIPS: init: Ensure reserved memory regions are not added to bootmem Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 27/27] MIPS: Use Makefile.postlink to insert relocations into vmlinux Levin, Alexander (Sasha Levin)
2017-11-08 20:51 ` [PATCH AUTOSEL for-3.18 26/27] 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=20171108205049.27612-1-alexander.levin@verizon.com \
--to=alexander.levin@one.verizon.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rogerq@ti.com \
--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®