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: 1830241 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork2.kernel.org (Postfix) with ESMTP id D5A9FDF254 for ; Sun, 2 Dec 2012 10:23:26 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qB2AIgca018430; Sun, 2 Dec 2012 04:18:42 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qB2AIgpH002660; Sun, 2 Dec 2012 04:18:42 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Sun, 2 Dec 2012 04:18:41 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id qB2AIf0E032048; Sun, 2 Dec 2012 04:18:41 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 8E98680627; Sun, 2 Dec 2012 04:18:41 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 26A6D80626 for ; Sun, 2 Dec 2012 04:18:37 -0600 (CST) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id qB2AIaEn024988 for ; Sun, 2 Dec 2012 04:18:36 -0600 (CST) Received: from psmtp.com (na3sys009amx210.postini.com [74.125.149.50]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id qB2AIao3017989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 2 Dec 2012 04:18:36 -0600 Received: from mail-qc0-f173.google.com ([209.85.216.173]) (using TLSv1) by na3sys009amx210.postini.com ([74.125.148.10]) with SMTP; Sun, 02 Dec 2012 10:18:36 GMT Received: by mail-qc0-f173.google.com with SMTP id b12so1030822qca.4 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: , , X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:18.65472/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:no-policies X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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(-) 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));