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: Arvind Yadav <arvind.yadav.cs@gmail.com>,
"Levin,
Alexander (Sasha Levin)" <alexander.levin@one.verizon.com>
Subject: [PATCH AUTOSEL for-3.18 07/27] drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache
Date: Wed, 8 Nov 2017 20:50:56 +0000 [thread overview]
Message-ID: <20171108205049.27612-7-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171108205049.27612-1-alexander.levin@verizon.com>
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
[ Upstream commit 1ae0d5af347df224a6e76334683f13a96d915a44 ]
Here, If devm_ioremap_nocache will fail. It will return NULL.
Kernel can run into a NULL-pointer dereference. This error check
will avoid NULL pointer dereference.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
drivers/gpu/drm/sti/sti_vtg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c
index 740d6e347a62..b0fc11ec6ab7 100644
--- a/drivers/gpu/drm/sti/sti_vtg.c
+++ b/drivers/gpu/drm/sti/sti_vtg.c
@@ -303,6 +303,10 @@ static int vtg_probe(struct platform_device *pdev)
return -ENOMEM;
}
vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
+ if (!vtg->regs) {
+ DRM_ERROR("failed to remap I/O memory\n");
+ return -ENOMEM;
+ }
np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0);
if (np) {
--
2.11.0
next prev parent reply other threads:[~2017-11-08 20:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 20:50 [PATCH AUTOSEL for-3.18 01/27] extcon: palmas: Check the parent instance to prevent the NULL 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 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 03/27] ARM: dts: Fix omap3 off mode pull defines 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 ` Levin, Alexander (Sasha Levin) [this message]
2017-11-08 20:50 ` [PATCH AUTOSEL for-3.18 05/27] ata: SATA_HIGHBANK " 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 12/27] scsi: lpfc: Add missing memory barrier 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 09/27] igb: close/suspend race in netif_device_detach 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 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 20/27] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap 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 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: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 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 23/27] MIPS: End asm function prologue macros with .insn 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 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 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 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-7-alexander.levin@verizon.com \
--to=alexander.levin@one.verizon.com \
--cc=arvind.yadav.cs@gmail.com \
--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®