Received: by 10.192.165.148 with SMTP id m20csp1758085imm; Thu, 26 Apr 2018 01:40:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Ub12fodvMBGDUE/CCKPrSEynrnsebLS1/J2X4vpZ8ykHuf2/zqWpF30Mm+COiocG/eIQ7 X-Received: by 10.99.117.92 with SMTP id f28mr17791138pgn.30.1524732023652; Thu, 26 Apr 2018 01:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732023; cv=none; d=google.com; s=arc-20160816; b=WK2XmZmSGBrzUvYZ+1TbUtmafFrng8gTM7ydi9W8pfQC9R9gtJkjdfIcw2iO5t6UCQ eKzkTkSg1Rrb7i60HA+0elJM85pB7fTH+r77JmcnrxWsbtoX5x3z/a/bj6JRSBxkqnC+ wqKymjCOaRN/9PFLulv1CGPu6Vd/ZHDRT5jj5GVpIZAo6EKAmzRD6fTrDfDAkVpwfoCI dHhAf7X+znJ3ckBFDSs5tac4Hdzyfe06RBy1N96fPV50FjEDCsV0sGBy+I4K9GKJVc7r KW96flyNSCzZ426Y/ECuAioAPijEH/c6ST7/m5X06ptCQuT/Mbavb6F7fYFgPPMwS/2z GVeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=5SD7AB9oH1G1520QtIT1u/mySZnKxgfFMu0HFgWpUho=; b=ZGTNMeW0BKtz/IZv3aQxlxNFAKGCJ8qqpr1FFNTlPLgolbm0aPPxfyuiwYpRbfBZwq qly7qufVIUoWxCWqsfcvk1y58EhrJ20L3sa8z6kP9WdP/8vFVorH7pmd6sL8aVPvE3JF HKsaBO8e3gqxpYkXGb2up2OkddLuw+uEVUK6VXMZ3hKDrE3UnMCJe015i+X/Qg8XipCi mu/U61nbhFq+gDwyaAOpSz0Nj9daX/fveLBbhJFiZi73LAx3Oq8Jd2BbI6TdRabwzKw3 SnuE0CbQpWr8uxk2jifDm2feoVLjzAko0H0BCluGXtgerrXOGCSdVFBUz5lDdUzm6onr 5GfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b38-v6si19277943pla.124.2018.04.26.01.40.09; Thu, 26 Apr 2018 01:40:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754668AbeDZIhh (ORCPT + 99 others); Thu, 26 Apr 2018 04:37:37 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:47304 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753717AbeDZIhd (ORCPT ); Thu, 26 Apr 2018 04:37:33 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2001:1bc8:1a6:d3d5::80:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id E32FA634C54; Thu, 26 Apr 2018 11:37:31 +0300 (EEST) Received: from sakke by valkosipuli.localdomain with local (Exim 4.89) (envelope-from ) id 1fBcPD-0001OQ-KK; Thu, 26 Apr 2018 11:37:31 +0300 Date: Thu, 26 Apr 2018 11:37:31 +0300 From: Sakari Ailus To: Colin King Cc: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] media: ispstat: don't dereference user_cfg before a null check Message-ID: <20180426083731.72bmygsp2waf3eeu@valkosipuli.retiisi.org.uk> References: <20180424130618.18211-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424130618.18211-1-colin.king@canonical.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 02:06:18PM +0100, Colin King wrote: > From: Colin Ian King > > The pointer user_cfg (a copy of new_conf) is dereference before > new_conf is null checked, hence we may have a null pointer dereference > on user_cfg when assigning buf_size from user_cfg->buf_size. Ensure > this does not occur by moving the assignment of buf_size after the > null check. > > Detected by CoverityScan, CID#1468386 ("Dereference before null check") > > Fixes: 68e342b3068c ("[media] omap3isp: Statistics") > Signed-off-by: Colin Ian King Thanks for the patch. Gustavo sent effectively the same patch a moment earlier, and that patch got applied instead. -- Sakari Ailus e-mail: sakari.ailus@iki.fi