From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46313C77B72 for ; Fri, 14 Apr 2023 17:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbjDNRNc (ORCPT ); Fri, 14 Apr 2023 13:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjDNRN3 (ORCPT ); Fri, 14 Apr 2023 13:13:29 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E4E26AB; Fri, 14 Apr 2023 10:13:28 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10680"; a="409720692" X-IronPort-AV: E=Sophos;i="5.99,197,1677571200"; d="scan'208";a="409720692" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2023 10:13:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10680"; a="779249884" X-IronPort-AV: E=Sophos;i="5.99,197,1677571200"; d="scan'208";a="779249884" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 14 Apr 2023 10:13:24 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pnMzC-00HDU9-0N; Fri, 14 Apr 2023 20:13:22 +0300 Date: Fri, 14 Apr 2023 20:13:21 +0300 From: Andy Shevchenko To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, Greg Kroah-Hartman , Hans de Goede , Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus , Xiaomeng Tong , cocci@inria.fr, LKML Subject: Re: [PATCH] media: atomisp: Move a variable assignment behind a null pointer check in atomisp_cp_general_isp_parameters() Message-ID: References: <40c60719-4bfe-b1a4-ead7-724b84637f55@web.de> <1a11455f-ab57-dce0-1677-6beb8492a257@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 13, 2023 at 10:20:15PM +0200, Markus Elfring wrote: > Date: Thu, 13 Apr 2023 22:08:42 +0200 > > The address of a data structure member was determined before > a corresponding null pointer check in the implementation of > the function “atomisp_cp_general_isp_parameters”. > > Thus avoid the risk for undefined behaviour by moving the assignment > for the variable “cur_config” behind the null pointer check. I don't think this is what is happening here. The check might be removed by optimizer in the compiler. > This issue was detected by using the Coccinelle software. > > Fixes: ad85094b293e40e7a2f831b0311a389d952ebd5e ("Revert 'media: staging: atomisp: Remove driver'") Wrong tag format. Code-wise I'm not against this, but it's up to Hans. -- With Best Regards, Andy Shevchenko