From patchwork Wed Oct 3 13:42:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 1541601 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id F287540AC9 for ; Wed, 3 Oct 2012 13:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755768Ab2JCNmr (ORCPT ); Wed, 3 Oct 2012 09:42:47 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:62876 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755538Ab2JCNmp (ORCPT ); Wed, 3 Oct 2012 09:42:45 -0400 Received: by padhz1 with SMTP id hz1so6347164pad.19 for ; Wed, 03 Oct 2012 06:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=rF4Pm1waT5A7oqEnJhKbS5AZFhQf61mViQXgJdyGIW4=; b=n1aWCVKCLRTFYrDWsxMW03BWP7S83zRWF59uor78YOCrle7mRGSNCV7dLmmfLUa8R3 pLgnDeDbuXpukqdeoG3f5PwItLY5vWhdiLhWnpuH9RNWxU9IVHEQePn7x3XUZNkc1fDc ns9pY0zJsATtDfn2TRVOvN8Z7Ql+93YBiUgc6Iq1MWjL0uikxAQRg+JAmPnZlWURRtqq JGCfoMF6o4HHyWlH/CbvnDoScBXriFV2qjeKGpG3Ex1K/+/HvfwvEZVuhH6cloE8WKMb g1HCoZhiykCIe2i1t/gSuDENGmCIxT/AztAXCSUYpsuU/oKt6sHKsJAH4f8TMDS8vH40 MBQQ== Received: by 10.68.221.166 with SMTP id qf6mr13085945pbc.54.1349271765256; Wed, 03 Oct 2012 06:42:45 -0700 (PDT) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPS id my10sm2645496pbc.11.2012.10.03.06.42.40 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 06:42:44 -0700 (PDT) From: Prabhakar To: DLOS , LMML Cc: Manjunath Hadli , VGER , "Lad, Prabhakar" , Hans Verkuil Subject: [PATCH] media: davinci: vpif: Add return code check at vb2_queue_init() Date: Wed, 3 Oct 2012 19:12:29 +0530 Message-Id: <1349271749-24426-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad, Prabhakar from commit with id 896f38f582730a19eb49677105b4fe4c0270b82e it's mandatory to check the return code of vb2_queue_init(). Signed-off-by: Lad, Prabhakar Signed-off-by: Manjunath Hadli Cc: Hans Verkuil --- drivers/media/platform/davinci/vpif_capture.c | 8 ++++++-- drivers/media/platform/davinci/vpif_display.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 83b80ba..3521725 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -976,6 +976,7 @@ static int vpif_reqbufs(struct file *file, void *priv, struct common_obj *common; u8 index = 0; struct vb2_queue *q; + int ret; vpif_dbg(2, debug, "vpif_reqbufs\n"); @@ -1015,8 +1016,11 @@ static int vpif_reqbufs(struct file *file, void *priv, q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct vpif_cap_buffer); - vb2_queue_init(q); - + ret = vb2_queue_init(q); + if (ret) { + vpif_err("vpif_capture: vb2_queue_init() failed\n"); + return ret; + } /* Set io allowed member of file handle to TRUE */ fh->io_allowed[index] = 1; /* Increment io usrs member of channel object to 1 */ diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index ae8329d..84cee9d 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -936,6 +936,7 @@ static int vpif_reqbufs(struct file *file, void *priv, enum v4l2_field field; struct vb2_queue *q; u8 index = 0; + int ret; /* This file handle has not initialized the channel, It is not allowed to do settings */ @@ -981,8 +982,11 @@ static int vpif_reqbufs(struct file *file, void *priv, q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct vpif_disp_buffer); - vb2_queue_init(q); - + ret = vb2_queue_init(q); + if (ret) { + vpif_err("vpif_display: vb2_queue_init() failed\n"); + return ret; + } /* Set io allowed member of file handle to TRUE */ fh->io_allowed[index] = 1; /* Increment io usrs member of channel object to 1 */