From: Dan Carpenter Date: Tue, 18 Oct 2011 06:07:51 +0000 (+0300) Subject: drm/nouveau: testing the wrong variable X-Git-Tag: v3.2-rc2~24^2~6^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef5ced4bfe48ba2acb16e867ceb9c473dd0ef192;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c index 9f178aa94162c..33d03fbf00df5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_perf.c +++ b/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; }