From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C2E73451D6 for ; Wed, 7 Jan 2026 19:43:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767815035; cv=none; b=to8K7pSCQzMb8IIyfmJl+rpns7t7neJITlwP/Nvry/elsAmnFtU9qYT96TKc71r6NfyF21LLpUfQ3iFYMrYVp5NDZ4cWge7SOoaRRdQRwKGwnypf9hGN1pzY1dRRvVBWF4i6BNTu6HiaQaBCH5b/67r5j09SRHp68wsf+lziSNw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767815035; c=relaxed/simple; bh=H4kQ2ImpfCXfEiF09CqkE7nLS72g/BDW/WAuAGSer90=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KhuBGW6P1KtBv11922xx+iBM6FzOInEAsCQ1nFgN8L2JJKIx+SF6HbLzaQxnlBNjmWghLufqWv40rTHz6s9O9N1dSewI1AhpF/UHdr1xBo/WLsbb+RBcvyoVbbJVaN31YxwZKCOHtu9O+LgNrNm4UCWBI6j7BsC50lyVlSjM5Io= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=imzq0eim; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="imzq0eim" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-477563e28a3so9422675e9.1 for ; Wed, 07 Jan 2026 11:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767815022; x=1768419822; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=hfhdkkmV7GAX86e2yZLGIC3icQWfc8GaVLQ0woZU3MY=; b=imzq0eim7+5A9yC21FSKWQgvJm23Cq6SQs7yxpV+y3mOGVXOmwFdRSrcP1kHajpcNu RiWmLhIUXoCnOL8syLivgD1+xWaTIpMgAAy5U87ZB5bSNU32OE2/il9jv1XTvbFRqaQy wJ9tipl3RM2sInkLYfyrc4d3/dfh8M7AnxduCwjU0PIYskKisSrXUVVBi8RWcl6sdbT6 brwwvUFGyJAxiQPSsomAvagZ2L2K31IEGt6CdMc0Ibns4YvzM6OaYtboenbxJpMaecv1 9FSVmScW9nXVEBiIOZkAo/LKm+PQ+Wvw6b2a2ue+PqVOIe2dkWD8QhiDdIIAUue/ouvP obcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767815022; x=1768419822; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hfhdkkmV7GAX86e2yZLGIC3icQWfc8GaVLQ0woZU3MY=; b=nbXhOGeKyYjiLMOy7aNgQsIbZiIrn1iuvzKiiIBtnCVtzd/cVl0aJueOILhX/oJ8j2 AaIRQGqrOFBenDQSLUg94pAylwVaFxWk4eSmYaxNs6LAp6RFAMgjokDLlVB4fGbxc1wN yYdRFxrDou4uYnLLFPedxIEb8lzuflRoFsUZQMAqxgdHpBKDjzWVdBGTHF64JPd/0Tyn E6Jxrs3vSVIBtHUZS1I2mdM78xCn+bUQdiJmnOjS68wB+QeTmEcqnPwgBHse1vs8LGXJ LohOljMYDgXaveN7TJedNp2xoibe01VeQVK3lAMWbQz0LGNdq24EUid0ozHDjK0HSSNN 7dFw== X-Forwarded-Encrypted: i=1; AJvYcCVA6PHQtOdOxBZtKzzI7lLvxypQ0PScFZzEeW6dtuSclzIWyM7mKLmlWpGWRR5Ay99DGibvswNmddjYMak=@vger.kernel.org X-Gm-Message-State: AOJu0YzjnTdgUM8R/3aHi2Vkuf6MH9zegD4AlBFnfOBGfZqvdVqTj75k MA/AtCaHVbjqVd7PWk045HnEo4SzLUhjCmsekUTMrCB/TANRFg85Hc8CPDklBR5P1f4= X-Gm-Gg: AY/fxX4glvPTQdD+KtmSCHESYTO9fgKBCjwkMumVNxQIcZDTuBVW71hNhSy78ta+ux5 HhViezV92ahPlNj2iTjFKhOS8kcpfrCBfq8z8CSjThcWafLhAHcqeWDJkMY+3ZPQYUHXprwzACn N4xWU7RijjkXXkZ8jxnxPspWCL8I+lNgToACFxIwm0GsLvSxlDRSsHMfEdop537Kyq901cIneww sdVCREVzQFPBHHv3dPbpd3xeZ/iuWzoayGY03Eb+F+O/LnrtjETJwXRLNygj8ScdKj50baYoRcq 6XO+1sqVHrgUFBYibtctIvm7ZutIIhQXMowS6cfsRODnGM1ujXBLgQsliPaDDbuvkBob3GQaFpN tK+PASVn7tO3o1P1oVdTpRA3vkxGgbDNcjSHC+2pO1kC34rITy0TCn6Av4DJnB+Q3ulms5HcKcR C1FCMtnD2Ud1+eTvFa X-Google-Smtp-Source: AGHT+IF+nx5zCtfYVsKIp8PB8gUjhPK5j02V7HcCtFysVmUTplF5yysifhIl1OB40IVLi4DTO94Aqw== X-Received: by 2002:a05:600c:1f8f:b0:47d:6c36:a125 with SMTP id 5b1f17b1804b1-47d8487f5cfmr44268665e9.17.1767815022126; Wed, 07 Jan 2026 11:43:42 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d865f84besm22141875e9.1.2026.01.07.11.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 11:43:41 -0800 (PST) Date: Wed, 7 Jan 2026 22:43:38 +0300 From: Dan Carpenter To: Benoit Masson Cc: oe-kbuild@lists.linux.dev, jdelvare@suse.com, Guenter Roeck , lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: it87: describe per-chip temperature resources Message-ID: References: <20251226203021.27244-1-yahoo@perenite.com> <202512300415.VRCQoZYs-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jan 07, 2026 at 08:18:53PM +0100, Benoit Masson wrote: > On Mon, Jan 5, 2026 at 11:10 AM Dan Carpenter wrote: > > > > Hi benoit.masson, > > > > kernel test robot noticed the following build warnings: > > > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > > > url: https://github.com/intel-lab-lkp/linux/commits/benoit-masson/hwmon-it87-describe-per-chip-temperature-resources/20251227-043108 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next > > patch link: https://lore.kernel.org/r/20251226203021.27244-1-yahoo%40perenite.com > > patch subject: [PATCH] hwmon: it87: describe per-chip temperature resources > > config: x86_64-randconfig-161-20251229 (https://download.01.org/0day-ci/archive/20251230/202512300415.VRCQoZYs-lkp@intel.com/config) > > compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > > the same patch/commit), kindly add following tags > > | Reported-by: kernel test robot > > | Reported-by: Dan Carpenter > > | Closes: https://lore.kernel.org/r/202512300415.VRCQoZYs-lkp@intel.com/ > > > > smatch warnings: > > drivers/hwmon/it87.c:1694 show_pwm_temp_map() warn: variable dereferenced before IS_ERR check 'data' (see line 1691) > > > > vim +/data +1694 drivers/hwmon/it87.c > > > > 94ac7ee616809d Jean Delvare 2010-03-05 1685 static ssize_t show_pwm_temp_map(struct device *dev, > > 94ac7ee616809d Jean Delvare 2010-03-05 1686 struct device_attribute *attr, char *buf) > > 94ac7ee616809d Jean Delvare 2010-03-05 1687 { > > 94ac7ee616809d Jean Delvare 2010-03-05 1688 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); > > 94ac7ee616809d Jean Delvare 2010-03-05 1689 struct it87_data *data = it87_update_device(dev); > > c962024e306ed5 Guenter Roeck 2015-04-04 1690 int nr = sensor_attr->index; > > 542f1e57c17849 benoit.masson 2025-12-26 @1691 u8 num_map = data->num_temp_map ?: IT87_TEMP_MAP_DEFAULT; > > ^^^^^^^^^^^^^^^^^^ > > Unchecked dereference > > > > 94ac7ee616809d Jean Delvare 2010-03-05 1692 int map; > > 94ac7ee616809d Jean Delvare 2010-03-05 1693 > > 0282ba4a4fe6c8 Frank Crawford 2023-04-16 @1694 if (IS_ERR(data)) > > ^^^^ > > Checked too late. > > > > 0282ba4a4fe6c8 Frank Crawford 2023-04-16 1695 return PTR_ERR(data); > > 0282ba4a4fe6c8 Frank Crawford 2023-04-16 1696 > > 0624d861983c2c Guenter Roeck 2015-04-06 1697 map = data->pwm_temp_map[nr]; > > > > Hi Dan, > > Indeed I’d move the num_map assignment below the IS_ERR(data) > > Is proposing a new patch V2 below the right appraoch ? This doesn't seem to have hit linux-next yet, so sending a v2 sounds good. regards, dan carpenter