From patchwork Fri Apr 11 13:04:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 3968301 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C675B9F336 for ; Fri, 11 Apr 2014 13:04:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB708207D3 for ; Fri, 11 Apr 2014 13:04:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4FE8207CF for ; Fri, 11 Apr 2014 13:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673AbaDKNEM (ORCPT ); Fri, 11 Apr 2014 09:04:12 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:49247 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754198AbaDKNEL (ORCPT ); Fri, 11 Apr 2014 09:04:11 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi2so963349wib.5 for ; Fri, 11 Apr 2014 06:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+4OnQrEh3yqjF1+mQyJrdRcbm6JkKPkyFkiO2PNc30o=; b=0UQX7uvvQC7ecbfRgCj8hIiGubFd3T4al8w90YIcs7WWnsR3z/VC3Y7TwNnzloazLp nZYTBwCd6cMXeRR7+s48MldYLNhnTxDPD4LeCqq/BlUvM2zP+1IFj3j7n6qhR2n9lyck QqGmJ52bOOLCe3bChoN499Orp7NXWZZXVNFaC6CbXEbNN32ctylgzaz0pdRYwfX8XSrk trUsExOK9ocOzfZXxKRsIBzK0wMh383JmSLI0L7bj9Im2+A37BjUo7+lNQO8SGZq4w48 ZjEQMdJ+bKdegTTX5r2laIRC/0NfwAT3repNaqp4oxkznBkPnz42IVTaXfK22l2HTLkX FoCA== MIME-Version: 1.0 X-Received: by 10.180.100.169 with SMTP id ez9mr3433272wib.11.1397221449374; Fri, 11 Apr 2014 06:04:09 -0700 (PDT) Received: by 10.216.125.2 with HTTP; Fri, 11 Apr 2014 06:04:09 -0700 (PDT) In-Reply-To: <20140411110822.GO4963@mwanda> References: <20131106161342.GD15603@elgon.mountain> <20140411110822.GO4963@mwanda> Date: Fri, 11 Apr 2014 10:04:09 -0300 Message-ID: Subject: Re: [media] coda: update CODA7541 to firmware 1.4.50 From: Fabio Estevam To: Dan Carpenter Cc: Philipp Zabel , linux-media 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.7 required=5.0 tests=BAYES_00,BIGNUM_EMAILS, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Hi Dan/Philipp, On Fri, Apr 11, 2014 at 8:08 AM, Dan Carpenter wrote: > What ever happened with this? > > regards, > dan carpenter > > On Wed, Nov 06, 2013 at 07:13:43PM +0300, Dan Carpenter wrote: >> Hello Philipp Zabel, >> >> This is a semi-automatic email about new static checker warnings. >> >> The patch 5677e3b04d3b: "[media] coda: update CODA7541 to firmware >> 1.4.50" from Jun 21, 2013, leads to the following Smatch complaint: >> >> drivers/media/platform/coda.c:1530 coda_alloc_framebuffers() >> error: we previously assumed 'ctx->codec' could be null (see line 1521) >> >> drivers/media/platform/coda.c >> 1520 >> 1521 if (ctx->codec && ctx->codec->src_fourcc == V4L2_PIX_FMT_H264) >> ^^^^^^^^^^ >> Patch introduces a new NULL check. >> >> 1522 height = round_up(height, 16); >> 1523 ysize = round_up(q_data->width, 8) * height; >> 1524 >> 1525 /* Allocate frame buffers */ >> 1526 for (i = 0; i < ctx->num_internal_frames; i++) { >> 1527 size_t size; >> 1528 >> 1529 size = q_data->sizeimage; >> 1530 if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 && >> ^^^^^^^^^^^^^^^^^^^^^^ >> Patch introduces a new unchecked dereference. >> >> 1531 dev->devtype->product != CODA_DX6) >> 1532 ctx->internal_frames[i].size += ysize/4; Would the fix below address this issue? the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c @@ -1518,7 +1518,10 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, int ret; int i; - if (ctx->codec && ctx->codec->src_fourcc == V4L2_PIX_FMT_H264) + if (!ctx->codec) + return -EINVAL; + + if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264) height = round_up(height, 16); ysize = round_up(q_data->width, 8) * height; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in