Skip to contentSkip to conversation

drm/nouveau: testing the wrong variable

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 18, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: testing the wrong variable

memtimings is a valid pointer here, the intent was to test for kcalloc() failure.

drivers/gpu/drm/nouveau/nouveau_perf.c +1 -1
index 9f178aa..33d03fb 100644
@@ -239,7 +239,7 @@ nouveau_perf_init(struct drm_device *dev)
 	if(version = 0x15) {
 		memtimings->timing  				kcalloc(entries, sizeof(*memtimings->timing), GFP_KERNEL);
-		if(!memtimings) {
+		if (!memtimings->timing) {
 			NV_WARN(dev,"Could not allocate memtiming table\n");
 			return;
 		}
Applied
#1 lore raw
Quoted 2 lines · Dan Carpenter

memtimings is a valid pointer here, the intent was to test for kcalloc() failure.

I've queued it, thanks!

Ben.

Quoted 16 lines
drivers/gpu/drm/nouveau/nouveau_perf.c +1 -1
index 9f178aa..33d03fb 100644
@@ -239,7 +239,7 @@ nouveau_perf_init(struct drm_device *dev)
 	if(version == 0x15) {
 		memtimings->timing =
 				kcalloc(entries, sizeof(*memtimings->timing), GFP_KERNEL);
-		if(!memtimings) {
+		if (!memtimings->timing) {
 			NV_WARN(dev,"Could not allocate memtiming table\n");
 			return;
 		}