Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp261492imm; Thu, 14 Jun 2018 19:48:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIpVjKDgVJ4dO0fMiFFS2/wuy7aEGl8gMFTKlf1dkN9kX+QcIcmU6fCXbHkrzivBGpnza+f X-Received: by 2002:a17:902:125:: with SMTP id 34-v6mr5842445plb.42.1529030888537; Thu, 14 Jun 2018 19:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529030888; cv=none; d=google.com; s=arc-20160816; b=F/UeYzPprjBCAV/8+Q6IdQu+cle9V0xeW5JSgN50htZga5j0Bv+H19Nleyn9dizqY6 l/VydslY2sSGAWGACHpki+fx09JbZASGKlhl/jd6IzjFtaw+nrnx7r3Y7iwBnQ320zHl SWnrdNBAztKmq8gN6i/ZKRptKunIvFDGp0DyO6+mURegRV+F90Ir6qVBWLgnsrKVEYnf Q+pVR8Wfhw7HAeGxR7BJc7CECvpmbrTzPOy27xr1qg6+k+dlj9WaJEHldjT5b2o4P0Wc arkj06mID1g19Ya9W/3vu470Y9PdlfP9oNjTD3kG09W32ZSCp602f7zZI/433Z8oSB4H uszg== 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:dkim-signature:arc-authentication-results; bh=qtg//35iDJAV+Jn+SRVYNNk7jV28Y8tP+R/xqZ5bpYA=; b=hVIqJQgTTdNSO3x+uCON5DUrOtcft7dJydQoS0JGvJAhT4ZW9v4hbFBpnUdHuoQkKw tWWdEvUCqAsNLfe9KgBbSxTETnSHEPxD9yvRDvoHGo5NmoRc+w+c0dZdamWZ6rKqvBF4 VOorlSp5sd7OwzCYyTjfp84r3eOylN+oTL9Lt578Wo3cxwpliFzAuLmooKS7nhLbDgWn NK+mxwxtF1bLa7lGzYJY2YRVcx28SdOAD5WBOas7zslK9EL+hcOjdb0vfpXt29zsDrK7 zimAg7AGkoGgy01xT89Vtjv0EAJ72N2HvpjguUQsaEC6Bk413UPvKjJEAJi0uPMTzvso 3KRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jItcSqYv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8-v6si5449859pgv.443.2018.06.14.19.47.54; Thu, 14 Jun 2018 19:48:08 -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; dkim=pass header.i=@linaro.org header.s=google header.b=jItcSqYv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965494AbeFOCqc (ORCPT + 99 others); Thu, 14 Jun 2018 22:46:32 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34000 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964995AbeFOCqa (ORCPT ); Thu, 14 Jun 2018 22:46:30 -0400 Received: by mail-pl0-f66.google.com with SMTP id g20-v6so4583326plq.1 for ; Thu, 14 Jun 2018 19:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qtg//35iDJAV+Jn+SRVYNNk7jV28Y8tP+R/xqZ5bpYA=; b=jItcSqYvDLPW5oEg7DtmfSdMHYluQuTw1fZGzTZhSkR+ixd3357Q9bRbFpbjNFFnln IYBu/hBlwCvFez3uaEsMF9DmDw7O9zz24HCb3rQFjyHb/HMv8lSy3zcdpfM7oeHWxMWk 9Iu5GtXye1WKmLIYHNtR9oMuIkuzBl8cip0sw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qtg//35iDJAV+Jn+SRVYNNk7jV28Y8tP+R/xqZ5bpYA=; b=uMhxxCMi6FN/Ke0lDmGeZkTqvGO0eiJkXyH8/2B6ro91JjdYvmmEuPvKONrjkGhfWB ezXOaKBofLTPKTVt1sB6Dw2BTqqiuPbdpGvms++kSg4lC86Zgl/4ZTHM4JHfAJGZv1JG cVPzOFLzAFs9G8J14qS8L6FCNYB+LkFMaWbmUEbxhqx4obS+d8a4tzqdc8vo1/tLSP+C 40u9cUMiMB4oqNZKPEuKnPsDK6vJWnX3/XSYUQRzs2ov1j4Al9HeEdIHQKx+6RoZTUs9 RyLEhggF1fl89nSGibvADLWVXfjulDMSkUecO1tBVVs/ZwNh6py5/lOEertCmg3wkNaA 3zeQ== X-Gm-Message-State: APt69E3XItVTs1nfyCvTxaWjb8W5TO3f8ALnb0I934LiIwDv1Ac335gB WbmzjjvUELTCtEwiM6e6X0nvcw== X-Received: by 2002:a17:902:a581:: with SMTP id az1-v6mr5897768plb.61.1529030789994; Thu, 14 Jun 2018 19:46:29 -0700 (PDT) Received: from localhost ([122.167.141.115]) by smtp.gmail.com with ESMTPSA id 76-v6sm17198445pfr.172.2018.06.14.19.46.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 19:46:29 -0700 (PDT) Date: Fri, 15 Jun 2018 08:16:25 +0530 From: Viresh Kumar To: ilia.lin@gmail.com Cc: Ilia Lin , "Rafael J . Wysocki" , Dan Carpenter , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: kryo: Fix possible error code dereference Message-ID: <20180615024625.rzr4644n77zrtomm@vireshk-i7> References: <20180614202921.32535-1-ilia.lin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180614202921.32535-1-ilia.lin@gmail.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14-06-18, 22:29, ilia.lin@gmail.com wrote: > From: Ilia Lin > > In event of error returned by the nvmem_cell_read() non-pointer value > may be dereferenced. Fix this with error handling. > > Signed-off-by: Ilia Lin Fixes tag ? > --- > drivers/cpufreq/qcom-cpufreq-kryo.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c > index d049fe4b80c4..5e9511223ce9 100644 > --- a/drivers/cpufreq/qcom-cpufreq-kryo.c > +++ b/drivers/cpufreq/qcom-cpufreq-kryo.c > @@ -115,6 +115,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) > > speedbin = nvmem_cell_read(speedbin_nvmem, &len); > nvmem_cell_put(speedbin_nvmem); > + if (IS_ERR(speedbin)) > + return PTR_ERR(speedbin); > > switch (msm8996_version) { > case MSM8996_V3: > -- > 2.11.0 -- viresh