From patchwork Fri Nov 29 07:50:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 3256691 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A0D3BBEEAD for ; Fri, 29 Nov 2013 07:50:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3D8B20657 for ; Fri, 29 Nov 2013 07:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7674320561 for ; Fri, 29 Nov 2013 07:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751177Ab3K2Hud (ORCPT ); Fri, 29 Nov 2013 02:50:33 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:22558 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089Ab3K2Huc (ORCPT ); Fri, 29 Nov 2013 02:50:32 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MX000IBRLS2YS10@mailout1.samsung.com> for linux-media@vger.kernel.org; Fri, 29 Nov 2013 16:50:26 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id AB.EB.18301.14748925; Fri, 29 Nov 2013 16:50:25 +0900 (KST) X-AuditID: cbfee68e-b7f7e6d00000477d-e9-52984741bed6 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 0C.6A.32308.14748925; Fri, 29 Nov 2013 16:50:25 +0900 (KST) Received: from localhost.localdomain ([10.252.75.83]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MX0008WXLRZBIN0@mmp1.samsung.com>; Fri, 29 Nov 2013 16:50:25 +0900 (KST) From: Seung-Woo Kim To: linux-media@vger.kernel.org, m.szyprowski@samsung.com, m.chehab@samsung.com Cc: pawel@osciak.com, sw0312.kim@samsung.com Subject: [PATCH] [media] videobuf2: Add log for size checking error in __qbuf_dmabuf Date: Fri, 29 Nov 2013 16:50:29 +0900 Message-id: <1385711429-5442-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsWyRsSkWNfRfUaQwcXpMhY9G7ayWlxcJ2+x 9shddospb3+yW8yY/JLNgdXj8a+XbB59W1YxenzeJBfAHMVlk5Kak1mWWqRvl8CVce31IaaC V2wVO1b0MTYwXmDtYuTkkBAwkZj6eSsbhC0mceHeeiCbi0NIYCmjxK1/s+GKljXNBysSEljE KPF5cxBEUSuTxIZLi5hAEmwCOhL7l/wGaxAR8Jdo2dzIAmIzA8XfbNgCZgsLhEm0Lb0MVsMi oCrx68l3ZhCbV8BVYtOnr0wQyxQkFtx7C3aFhMB9None51uYIBoEJL5NPgQ0iAMoISux6QAz RL2kxMEVN1gmMAouYGRYxSiaWpBcUJyUXmSkV5yYW1yal66XnJ+7iREYjKf/PevbwXjzgPUh xmSgcROZpUST84HBnFcSb2hsZmRhamJqbGRuaUaasJI476KHSUFCAumJJanZqakFqUXxRaU5 qcWHGJk4OKUaGBOUbk6edbj+nMlzDsGTE02v3zTTy8/Z/EDrSrxY+rvfcZvdddf+MZNs9HBb sbJoVvk9jnCP3ylfbOvV/x+vWCPDrc8hf4svyZJ585WHSwrnJNxxijl9M6afYX1vgEqKyssX z72aby3PSq+5bc0S8Vymu6N9WwDLa9MJuTUtsa+6tY15NBS+K7EUZyQaajEXFScCAJ99GVpc AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t9jAV1H9xlBBsu/ilj0bNjKanFxnbzF 2iN32S2mvP3JbjFj8ks2B1aPx79esnn0bVnF6PF5k1wAc1QDo01GamJKapFCal5yfkpmXrqt kndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO0EolhbLEnFKgUEBicbGSvh2mCaEhbroW MI0Rur4hQXA9RgZoIGENY8a114eYCl6xVexY0cfYwHiBtYuRk0NCwERiWdN8NghbTOLCvfVg tpDAIkaJz5uDuhi5gOxWJokNlxYxgSTYBHQk9i/5DdYsIuAv0bK5kQXEZgaKv9mwBcwWFgiT aFt6GayGRUBV4teT78wgNq+Aq8SmT1+ZIJYpSCy495ZtAiP3AkaGVYyiqQXJBcVJ6bmGesWJ ucWleel6yfm5mxjBof5MagfjygaLQ4wCHIxKPLwruqcHCbEmlhVX5h5ilOBgVhLh/VUEFOJN SaysSi3Kjy8qzUktPsSYDLR9IrOUaHI+MA7zSuINjU3MjCyNzA0tjIzNSRNWEuc90GodKCSQ nliSmp2aWpBaBLOFiYNTqoHR8kvbp3ze5G0BSn8ObPNnf7GxSnqShfyWSDuOuf13QheyRti9 MnzluX+PvMfl7+bOa7frJWjyKIXdjfy24cmZZUENMj9b738LtPDdYnBprtOnXXxisvps8/d1 upV5Pypir1Owm/+ir3rSoi2rL1b198lLhuornitN/rHrfZh/asj06GrVLYVKLMUZiYZazEXF iQB8DfzeuQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __qbuf_dmabuf checks whether size of provided dmabuf is large enough, and it returns error without any log. So this patch adds error log in the case. Signed-off-by: Seung-Woo Kim --- drivers/media/v4l2-core/videobuf2-core.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index b19b306..5faf10c 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1116,6 +1116,8 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b) if (planes[plane].length < planes[plane].data_offset + q->plane_sizes[plane]) { + dprintk(1, "qbuf: invalid dmabuf length for plane %d\n", + plane); ret = -EINVAL; goto err; }