* [patch] drm/nouveau: testing the wrong variable
@ 2011-10-18 6:07 Dan Carpenter
2011-10-18 6:20 ` Ben Skeggs
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-10-18 6:07 UTC (permalink / raw)
To: David Airlie
Cc: Emil Velikov, kernel-janitors, dri-devel, Ben Skeggs,
Martin Peres, Roy Spliet
memtimings is a valid pointer here, the intent was to test for
kcalloc() failure.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c
index 9f178aa..33d03fb 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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] drm/nouveau: testing the wrong variable
2011-10-18 6:07 [patch] drm/nouveau: testing the wrong variable Dan Carpenter
@ 2011-10-18 6:20 ` Ben Skeggs
0 siblings, 0 replies; 2+ messages in thread
From: Ben Skeggs @ 2011-10-18 6:20 UTC (permalink / raw)
To: Dan Carpenter
Cc: Emil Velikov, kernel-janitors, dri-devel, Martin Peres,
Roy Spliet
On Tue, 2011-10-18 at 09:07 +0300, Dan Carpenter wrote:
> memtimings is a valid pointer here, the intent was to test for
> kcalloc() failure.
I've queued it, thanks!
Ben.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c
> index 9f178aa..33d03fb 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;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-18 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 6:07 [patch] drm/nouveau: testing the wrong variable Dan Carpenter
2011-10-18 6:20 ` Ben Skeggs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox