From patchwork Tue May 28 09:51:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2624061 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id C141BDFB78 for ; Tue, 28 May 2013 11:15:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8DB6E617F for ; Tue, 28 May 2013 04:15:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f50.google.com (mail-bk0-f50.google.com [209.85.214.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C0A2E5BF9; Tue, 28 May 2013 02:51:46 -0700 (PDT) Received: by mail-bk0-f50.google.com with SMTP id ik8so3144076bkc.9 for ; Tue, 28 May 2013 02:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=OUJ737eveBAbJ3xVngRt+0LD3fZQutCLApgrLtbE/yA=; b=Jpx7aBVAd4xPpYM4Yq0EqjfcpH/8YOxH4jZT41c8ZGGHh8FTiWKrK9Lr+kG0AJQl5l PtB/AyynDU8w5HGGbtywLw5pIiOdLAhnSt8Ac0hh8ahCZ9cLXQxELSZY5MVgD8PLzU9K 0lHmyqtbw1ieS1ev4M9l4dA9ZxxbGhjZxI0B3ENTcFmLIzAbXXAhw08iu7wNiCWMn5vU rVHZj6MFmZathsEOxRDOIR9kGPkR3Uc9QISoQNRxJydrobmGgdJgBoyPwicNwAIOTqDj htMF6ja3LOKO4KXjUx3+Vb57ldr6zlOnExLWi+pLfq3UF9cpTgtEW8FoNM2ylySBJoyX 3ZGQ== MIME-Version: 1.0 X-Received: by 10.204.189.134 with SMTP id de6mr12464774bkb.126.1369734704652; Tue, 28 May 2013 02:51:44 -0700 (PDT) Received: by 10.204.39.1 with HTTP; Tue, 28 May 2013 02:51:44 -0700 (PDT) Date: Tue, 28 May 2013 17:51:44 +0800 Message-ID: Subject: [PATCH -next] drm/i915: fix error return code in init_pipe_control() From: Wei Yongjun To: daniel.vetter@ffwll.ch, airlied@linux.ie X-Mailman-Approved-At: Tue, 28 May 2013 04:15:17 -0700 Cc: yongjun_wei@trendmicro.com.cn, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Wei Yongjun Fix to return -ENOMEM in the kmap() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/gpu/drm/i915/intel_ringbuffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 5698fae..9b97cf6 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -464,9 +464,11 @@ init_pipe_control(struct intel_ring_buffer *ring) goto err_unref; pc->gtt_offset = obj->gtt_offset; - pc->cpu_page = kmap(sg_page(obj->pages->sgl)); - if (pc->cpu_page == NULL) + pc->cpu_page = kmap(sg_page(obj->pages->sgl)); + if (pc->cpu_page == NULL) { + ret = -ENOMEM; goto err_unpin; + } DRM_DEBUG_DRIVER("%s pipe control offset: 0x%08x\n", ring->name, pc->gtt_offset);