From patchwork Sun Dec 2 10:18:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1830231 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6159FDF254 for ; Sun, 2 Dec 2012 10:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487Ab2LBKSh (ORCPT ); Sun, 2 Dec 2012 05:18:37 -0500 Received: from mail-qa0-f53.google.com ([209.85.216.53]:64228 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808Ab2LBKSh (ORCPT ); Sun, 2 Dec 2012 05:18:37 -0500 Received: by mail-qa0-f53.google.com with SMTP id a19so611700qad.19 for ; Sun, 02 Dec 2012 02:18:35 -0800 (PST) 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=ynzuokjNz35MS78yz/Q1Ogp794TZ0tz6C1k9hU/GO3Q=; b=eXkxbMTzAnOapKbf6IGgb3fc+fQ+yUJO/MOvXYVISfaEhV0RlWihIje52nlDHM49fc i+V1ny2J+PWZGqpnPbudJxH8mnnpVqVv+TwvOruWN73ie95YYAKLMrbctrTEx3x1CwW2 kbjk9iQ73QXYlx/CuX09veJauHcp4JLpE//ePSLfJVBORYtuWWBJ33ir6c5pdx1xXDir Jrfp3lFPGKfywye/zriqZ4y9tJWJ+iQrsbsH3W2j579vlBW67FUpmlghaNbBggMRR27Y czonxznhhwURDRHtcErnkFwOsYrykJy9vxQysAYFnOTok2sqi9mpJJbzh1qvMQzdc+fG 3IgA== MIME-Version: 1.0 Received: by 10.224.195.136 with SMTP id ec8mr11341873qab.98.1354443515437; Sun, 02 Dec 2012 02:18:35 -0800 (PST) Received: by 10.229.126.165 with HTTP; Sun, 2 Dec 2012 02:18:35 -0800 (PST) Date: Sun, 2 Dec 2012 05:18:35 -0500 Message-ID: Subject: [PATCH -next] [media] media: davinci: vpbe: fix return value check in vpbe_display_reqbufs() From: Wei Yongjun To: manjunath.hadli@ti.com, prabhakar.lad@ti.com, mchehab@redhat.com Cc: yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org, davinci-linux-open-source@linux.davincidsp.com Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Wei Yongjun In case of error, the function vb2_dma_contig_init_ctx() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Acked-by: Prabhakar Lad --- drivers/media/platform/davinci/vpbe_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 2bfde79..e181a52 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -1393,9 +1393,9 @@ static int vpbe_display_reqbufs(struct file *file, void *priv, } /* Initialize videobuf queue as per the buffer type */ layer->alloc_ctx = vb2_dma_contig_init_ctx(vpbe_dev->pdev); - if (!layer->alloc_ctx) { + if (IS_ERR(layer->alloc_ctx)) { v4l2_err(&vpbe_dev->v4l2_dev, "Failed to get the context\n"); - return -EINVAL; + return PTR_ERR(layer->alloc_ctx); } q = &layer->buffer_queue; memset(q, 0, sizeof(*q));