From e67cd7dda9d7d6d82f4026f246d07bf4c4021a57 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Sun, 22 Jun 2008 18:47:51 +0200 Subject: NV50: A few minor added safeties + cleanup. --- linux-core/nv50_lut.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux-core/nv50_lut.c') diff --git a/linux-core/nv50_lut.c b/linux-core/nv50_lut.c index 570900ba..cb52f27f 100644 --- a/linux-core/nv50_lut.c +++ b/linux-core/nv50_lut.c @@ -37,6 +37,9 @@ static int nv50_lut_alloc(struct nv50_crtc *crtc) NV50_DEBUG("\n"); + if (!file_priv) + return -ENOMEM; + /* Any file_priv should do as it's pointer is used as identification. */ block = nouveau_mem_alloc(crtc->dev, 0, 4096, flags, file_priv); @@ -137,6 +140,9 @@ int nv50_lut_create(struct nv50_crtc *crtc) crtc->lut = kzalloc(sizeof(struct nv50_lut), GFP_KERNEL); + if (!crtc->lut) + return -ENOMEM; + rval = nv50_lut_alloc(crtc); if (rval != 0) return rval; -- cgit v1.2.3