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: 23554 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1WYb7x-0007Sg-HP; Fri, 11 Apr 2014 15:04:17 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-8) with esmtp id 1WYb7v-0000GQ-jT; Fri, 11 Apr 2014 15:04:17 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673AbaDKNEM (ORCPT + 1 other); 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-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.4.11.125419 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_HTTP_RECEIVED 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0, __SANE_MSGID 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' 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