From patchwork Wed May 4 16:21:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ismael Luceno X-Patchwork-Id: 9016321 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC3069F30C for ; Wed, 4 May 2016 16:21:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60F6C203AB for ; Wed, 4 May 2016 16:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F56320398 for ; Wed, 4 May 2016 16:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbcEDQVo (ORCPT ); Wed, 4 May 2016 12:21:44 -0400 Received: from iodev.co.uk ([82.211.30.53]:34224 "EHLO iodev.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751230AbcEDQVo (ORCPT ); Wed, 4 May 2016 12:21:44 -0400 Received: from localhost (host169.186-109-120.telecom.net.ar [186.109.120.169]) by iodev.co.uk (Postfix) with ESMTPSA id E7FA81F0EE; Wed, 4 May 2016 12:20:11 -0400 (EDT) From: Ismael Luceno To: linux-media@vger.kernel.org Cc: Hans Verkuil , Andrey Utkin , Ismael Luceno Subject: [PATCH v2 1/2] solo6x10: Set FRAME_BUF_SIZE to 200KB Date: Wed, 4 May 2016 13:21:20 -0300 Message-Id: <1462378881-16625-1-git-send-email-ismael@iodev.co.uk> X-Mailer: git-send-email 2.8.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.0 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 From: Andrey Utkin Such frame size is met in practice. Also report oversized frames. [ismael: Reworked warning and commit message] Signed-off-by: Ismael Luceno --- drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c index 67a14c4..f98017b 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c @@ -33,7 +33,7 @@ #include "solo6x10-jpeg.h" #define MIN_VID_BUFFERS 2 -#define FRAME_BUF_SIZE (196 * 1024) +#define FRAME_BUF_SIZE (200 * 1024) #define MP4_QS 16 #define DMA_ALIGN 4096 @@ -323,8 +323,11 @@ static int solo_send_desc(struct solo_enc_dev *solo_enc, int skip, int i; int ret; - if (WARN_ON_ONCE(size > FRAME_BUF_SIZE)) + if (WARN_ON_ONCE(size > FRAME_BUF_SIZE)) { + dev_warn(&solo_dev->pdev->dev, + "oversized frame (%d bytes)\n", size); return -EINVAL; + } solo_enc->desc_count = 1;