Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp441873lqt; Thu, 18 Apr 2024 23:40:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTwzqc/JCtaGkCWjObyjftXdZvq4UoHz3EfVL9q1Hit94oSxNWaqU00igGEQGhcFcbIRSk4AWllcKiZhcjMgfE2XfTbrOfnO6fjmYREA== X-Google-Smtp-Source: AGHT+IEC4jQuldW8wQ4OCfnOqgGIB4kWhkUTL0R+TM+UQxW0lk4lopCi9eNlG9Rily8mA+4qPXA3 X-Received: by 2002:a05:6808:128f:b0:3c7:49c2:e364 with SMTP id a15-20020a056808128f00b003c749c2e364mr714616oiw.11.1713508808665; Thu, 18 Apr 2024 23:40:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713508808; cv=pass; d=google.com; s=arc-20160816; b=JWZn6luLYAaUOPVsD7j3Tvu3E9qzxOpfPjSLwnajMWhZDG7gY0sH950Cmfi5GO2CFZ V97d1QZWVyBzFS37N4+iEYccd3C4rsWoq+VEl0808nvF4JXBB0GSmWALJvXG23Da4zWk C5R9Ds23nnLv/u4hUAXwAD5U1+0eDjTHifCXTeOYFuA+kLdxTVyxpUwTEhJIOgFKQsqF m3IUAwabfEWkk0fPpaRHv06bHXB1qT9JmUzbGqNUikJdWiLJkzFTFLcV2VJPzS5DnFji 6btixWqOwKHV43sbUSgbpX2tFlONADi44XPAWqaRgCJuSxxszj8XftRFZdwCQRiufUYF Asgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=behcu3HpDw80Nj2+p0givcvikiqXXCDSWOXRNk2VtxQ=; fh=jM0mUl699/C7coMQYZtTWVTFgcTdsF7RHwDqbcq/7TA=; b=jJjLciYTycXaXbWHim2rhbfPe6AQnv1tvGdevJVheuP7fHzU346LVVxiw65StdaIXy b91WXxbalgTwHsyXL0PthGAiZhJMgJjwNbE3MRdBLHBOkQIaeXtsyNzPNVz44xeWFBII Oznk0GZtjlMvyiGe0ROYfLe0wwrr9WxDVapI+73wGFT3ndH12eDlDi9KQpBL3BYgc+gX lrLFetzLUH/rhSMieDR/J/z84ZQcpeRRB8RgqoFr00RLcEyb1TQbY7wa+ud6+MopjE2o 8BK9F+wW6rBj8NfAYgnmcKjuRYCqHiQfx+QtdiU8dOoAR6ee4wMuCD3kzIj2kLnCzUTn C72Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=flcJxh5p; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-151063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n34-20020a634d62000000b005dccf9b1656si2785303pgl.414.2024.04.18.23.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 23:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=flcJxh5p; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-151063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A15F282FB9 for ; Fri, 19 Apr 2024 06:40:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A949381C8; Fri, 19 Apr 2024 06:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="flcJxh5p" Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 E736031A66 for ; Fri, 19 Apr 2024 06:39:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713508800; cv=none; b=oNA/ApVwsy4sxULe1DlRw7VtqmnuGRGSoq0jKg1wS/EkkM2hhvgRQ83NMggWMAe6E1NhgDw1TJ2RKE6/MpInOxp3hmndaVohPXKSyAorfIKi/8higNDdmXOv0YMZek5FcbP/IRNNjErfMTQzfX6Z4RLTpxkBvVeEbFMFkT6m/LU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713508800; c=relaxed/simple; bh=KO0xtQBpQZiR18joiWf/pJcceYmytvVfGuc9Q/51F+k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lAWV8MNvlFGXXSv7sm6S7ZfBn7aa9GkN33bx7tcvXQhdwAssNnAJCW4UyddwEyM+eWha/H2CkKdFXNzgAW7X3XgNUCt5hzXodFPt0QlvA+YM0yvRRmvIgc6sHVlZcsNX59QJyvWWtOXwelPd2hM9GWFCJakUN+dzqFZtoeXKb9g= 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=flcJxh5p; arc=none smtp.client-ip=209.85.214.181 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 Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1e411e339b8so13061105ad.3 for ; Thu, 18 Apr 2024 23:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713508798; x=1714113598; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=behcu3HpDw80Nj2+p0givcvikiqXXCDSWOXRNk2VtxQ=; b=flcJxh5pTRqmt1tEeDf4ShvoK8kfFrlWV03sHvgHpD3e1G+1oVT9c2Iu+q/aJjpYox dnpye0oFudh3dyqJa8twv9kBZEh39Ks3V9LMLwS3T0EOdrrnnUEncJnH8makE+s6oVb5 Ss3vI2Zg8bt1OYyVK33LdgQv0X/OP5V/k9DzE+Q96hPEBIBdNUBDLmXtX2m6RoG0dc/H HzSWEI3QhVH1I8KGc5zudJQ0nphwdEUPd5A05TmYmfux+63Qla8j2WTQKWVUu6mVqf0G WYBP6UcYgU5zji1hbKClu6JEKdCJ7Tlqa02PsYLQLWYHEaVfAKoluuoVNzEPQAJiytau 7PFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713508798; x=1714113598; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=behcu3HpDw80Nj2+p0givcvikiqXXCDSWOXRNk2VtxQ=; b=V20P5H75E4l4n576i5d8MBxdPn3o7flqw+cWfO0ACzF7o+f6siKvqXKCpCQk+rVUeG WAn5FFtPzfuSLM8UgGfWVRIaZNMiKIuSXzFjFtjb7X87XZeoHfZ7EGixFyPiYDzNWpYK v4DnU0LgMc5gnRQUpxiFxQo/Jl16KfOoOcw9SyqJzV9eMef6qsTZ/RCo7tEAJO+oIa9h rTE4p/H6DuwlQ3PaeEyauR3KltT0y10ujCNVMFhCVehS+6udOnHxgVvVeFfrgL6yvaSZ +l+g34qkSMuPXcLrj8Q4Q9uatjLPPe4QA2avXsDDisY9FXV00mS01ePjUgfXGlk588YZ hEVQ== X-Forwarded-Encrypted: i=1; AJvYcCUqiB6+SXgjHIZX9DMCdQ0IhqAV71qE8ImPjziHHN8juxH4fYTFbKbuXkOCsViufm/VLbh5ObgGmZeXczC/0CARgxMK5xKvZ6SviSEU X-Gm-Message-State: AOJu0YyAWy+WFIwyXed7kwJu19YkqlUwRx1GinzOtbYKz4AbhOnPowVl UavW0DZrFbMrhd1nKVy/fvSS24250HosT4USK1URCGBjwK38suVFjsReMJLiqSw= X-Received: by 2002:a17:902:ceca:b0:1e2:a449:da15 with SMTP id d10-20020a170902ceca00b001e2a449da15mr1420976plg.15.1713508798014; Thu, 18 Apr 2024 23:39:58 -0700 (PDT) Received: from localhost ([122.172.87.52]) by smtp.gmail.com with ESMTPSA id c17-20020a170903235100b001dddcfca329sm2588042plh.148.2024.04.18.23.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 23:39:57 -0700 (PDT) Date: Fri, 19 Apr 2024 12:09:55 +0530 From: Viresh Kumar To: Aleksandr Mishin Cc: Ionela Voinescu , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH v2] cppc_cpufreq: Fix possible null pointer dereference Message-ID: <20240419063955.jzfd6pfiag7kz2i6@vireshk-i7> References: <20240405094005.18545-1-amishin@t-argos.ru> <20240408093536.19485-1-amishin@t-argos.ru> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240408093536.19485-1-amishin@t-argos.ru> On 08-04-24, 12:35, Aleksandr Mishin wrote: > cppc_cpufreq_get_rate() and hisi_cppc_cpufreq_get_rate() can be called from > different places with various parameters. So cpufreq_cpu_get() can return > null as 'policy' in some circumstances. > Fix this bug by adding null return check. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: a28b2bfc099c ("cppc_cpufreq: replace per-cpu data array with a list") > Signed-off-by: Aleksandr Mishin > --- > v2: Fix mixed declarations > > drivers/cpufreq/cppc_cpufreq.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) Applied. Thanks. -- viresh