public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3 of 5 ] /drivers/char/drm ioremap balancing/ returncode check
@ 2007-08-13  4:04 Scott Thompson
  0 siblings, 0 replies; only message in thread
From: Scott Thompson @ 2007-08-13  4:04 UTC (permalink / raw)
  To: linux-kernel, kernel-janitors, dri-devel

patchset against 2.6.23-rc2 and this set is an audit of 
/drivers/char/a* 
through drivers/char .   

this corrects missing ioremap return checks and balancing on 
iounmap calls..

Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
----------------------------------------------------------
diff --git a/drivers/char/drm/drm_bufs.c 
b/drivers/char/drm/drm_bufs.c
index 923174c..448488b 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -177,8 +177,13 @@ static int drm_addmap_core(struct drm_device * 
dev, unsigned int offset,
 						     MTRR_TYPE_WRCOMB, 1);
 			}
 		}
-		if (map->type == _DRM_REGISTERS)
+		if (map->type == _DRM_REGISTERS) {
 			map->handle = ioremap(map->offset, map->size);
+			if (!map->handle) {
+				drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+				return -ENOMEM;
+			}
+		}
 		break;
 	case _DRM_SHM:
 		list = drm_find_matching_map(dev, map);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-13  4:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13  4:04 [PATCH 3 of 5 ] /drivers/char/drm ioremap balancing/ returncode check Scott Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox