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: 2625701 Return-Path: X-Original-To: patchwork-intel-gfx@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 49BB3DFB78 for ; Tue, 28 May 2013 15:55:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 384B8E61E0 for ; Tue, 28 May 2013 08:55:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@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: From: Wei Yongjun To: daniel.vetter@ffwll.ch, airlied@linux.ie X-Mailman-Approved-At: Tue, 28 May 2013 08:55:45 -0700 Cc: yongjun_wei@trendmicro.com.cn, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [Intel-gfx] [PATCH -next] drm/i915: fix error return code in init_pipe_control() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=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);