From patchwork Tue Feb 9 14:25:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Owain Ainsworth X-Patchwork-Id: 78049 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o19EQ3rd013684 for ; Tue, 9 Feb 2010 14:26:39 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC5DF9EB0B; Tue, 9 Feb 2010 06:26:02 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-fx0-f209.google.com (mail-fx0-f209.google.com [209.85.220.209]) by gabe.freedesktop.org (Postfix) with ESMTP id 464769EB08 for ; Tue, 9 Feb 2010 06:25:59 -0800 (PST) Received: by fxm1 with SMTP id 1so7885021fxm.24 for ; Tue, 09 Feb 2010 06:25:59 -0800 (PST) Received: by 10.223.101.143 with SMTP id c15mr7737786fao.91.1265725558873; Tue, 09 Feb 2010 06:25:58 -0800 (PST) Received: from stephanie.nicotinebsd.org (ns1.nicotinebsd.org [93.97.176.184]) by mx.google.com with ESMTPS id 19sm251003fkr.48.2010.02.09.06.25.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Feb 2010 06:25:57 -0800 (PST) Received: from localhost (1000@localhost [IPv6:::1]) by stephanie.nicotinebsd.org (OpenSMTPD) with ESMTP id 1265725555.zhWfp0C2EF9hsK4i; Tue, 9 Feb 2010 14:25:55 +0000 (GMT) Date: Tue, 9 Feb 2010 14:25:55 +0000 From: Owain Ainsworth To: intel-gfx@lists.freedesktop.org Message-ID: <20100209142555.GA28255@stephanie.nicotinebsd.org> MIME-Version: 1.0 Content-Disposition: inline Cc: Daniel Vetter Subject: [Intel-gfx] A couple of nice little bugs. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Feb 2010 14:26:39 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 6a17c60..3afe361 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -737,8 +737,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, if (cmdbuf->num_cliprects) { cliprects = kcalloc(cmdbuf->num_cliprects, sizeof(struct drm_clip_rect), GFP_KERNEL); - if (cliprects == NULL) + if (cliprects == NULL) { + ret = -ENOMEM; goto fail_batch_free; + } ret = copy_from_user(cliprects, cmdbuf->cliprects, cmdbuf->num_cliprects * diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index ddea92c..b88be0b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3699,8 +3699,10 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, if (args->num_cliprects != 0) { cliprects = kcalloc(args->num_cliprects, sizeof(*cliprects), GFP_KERNEL); - if (cliprects == NULL) + if (cliprects == NULL) { + ret = -ENOMEM; goto pre_mutex_err; + } ret = copy_from_user(cliprects, (struct drm_clip_rect __user *)