[alternative-merged] gpu-drm-i915-fix-potential-null-dereference.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     gpu: drm/i915, fix potential null dereference
has been removed from the -mm tree.  Its filename was
     gpu-drm-i915-fix-potential-null-dereference.patch

This patch was dropped because an alternative patch was merged

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: gpu: drm/i915, fix potential null dereference
From: Jiri Slaby <jslaby@xxxxxxx>

Stanse found a potential null dereference in i915_suspend.  There is a
check for dev and dev_priv being NULL, but dev is dereferenced earlier. 
Move the dereference after the check.

Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
Cc: David Airlie <airlied@xxxxxxxx>
Cc: Eric Anholt <eric@xxxxxxxxxx>
Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/gpu/drm/i915/i915_drv.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff -puN drivers/gpu/drm/i915/i915_drv.c~gpu-drm-i915-fix-potential-null-dereference drivers/gpu/drm/i915/i915_drv.c
--- a/drivers/gpu/drm/i915/i915_drv.c~gpu-drm-i915-fix-potential-null-dereference
+++ a/drivers/gpu/drm/i915/i915_drv.c
@@ -176,12 +176,17 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static int i915_suspend(struct drm_device *dev, pm_message_t state)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv;
 
-	if (!dev || !dev_priv) {
-		DRM_ERROR("dev: %p, dev_priv: %p\n", dev, dev_priv);
-		DRM_ERROR("DRM not initialized, aborting suspend.\n");
-		return -ENODEV;
+	if (!dev) {
+		DRM_ERROR("dev: %p\n", dev);
+		goto abort;
+	}
+
+	dev_priv = dev->dev_private;
+	if (!dev_priv) {
+		DRM_ERROR("dev_priv: %p\n", dev_priv);
+		goto abort;
 	}
 
 	if (state.event == PM_EVENT_PRETHAW)
@@ -211,6 +216,9 @@ static int i915_suspend(struct drm_devic
 	dev_priv->modeset_on_lid = 0;
 
 	return 0;
+abort:
+	DRM_ERROR("DRM not initialized, aborting suspend.\n");
+	return -ENODEV;
 }
 
 static int i915_resume(struct drm_device *dev)
_

Patches currently in -mm which might be from jslaby@xxxxxxx are

linux-next.patch
gpu-drm-i915-fix-potential-null-dereference.patch
infiniband-use-rlimit-helpers.patch
mtd-chips-cfi-remove-unneeded-null-checks.patch
mm-use-rlimit-helpers.patch
bootmem-avoid-dma32-zone-by-default.patch
fs-use-rlimit-helpers.patch
posix-cpu-timers-cleanup-rlimits-usage.patch
kernel-core-use-helpers-for-rlimits.patch
kernel-core-use-helpers-for-rlimits-fix.patch
ipc-use-rlimit-helpers.patch
edac-add-__init-to-i7core_xeon_pci_fixup.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux