Browse Source

drm/nouveau: testing the wrong variable

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Dan Carpenter 13 years ago
parent
commit
ef5ced4bfe
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gpu/drm/nouveau/nouveau_perf.c

+ 1 - 1
drivers/gpu/drm/nouveau/nouveau_perf.c

@@ -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;
 		}