Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1353297pxb; Fri, 21 Jan 2022 16:17:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFWYRCPkacU8qo0+/CUVdawDH+2XjNW+vTOly3ZmdIt/Sp7LB2icN9vNk5dAzu6k1XvAaI X-Received: by 2002:a17:902:e888:b0:14b:1ff1:b66a with SMTP id w8-20020a170902e88800b0014b1ff1b66amr4069154plg.159.1642810624740; Fri, 21 Jan 2022 16:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642810624; cv=none; d=google.com; s=arc-20160816; b=r+LOxbVRD3fhQgS9o5Fq99XBkCQUoQHnsgnGCMrTvwayV990vDNX1qM7v7jqk00kAK UKfJIOxDPChtVTN1LKC8OHaIC+EeKFg8BAF4SELQpvzQ4FR6DpPAM6YHYnjxUE9yZf56 I2qkbFpWDoOl9JDNielLAiWjWh7cqhN/v+xqR57tznESlaY2w5EYdWxFRGKOg9RcsZTg M8JdhaO8coKj/biyLNDEoIbtg+QpEPpPY41m9xn9y8k3V2GzG7H6vj/JEcvjkHdUPek0 uf7KuDIvHpC8LWorBSHFUTju7qrbw1ekCUMzmj1KN5FBdo/dEOzKgPvmogXNwci5xR3t +XOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=CbvFbjQfwDtoDzlP5NcZT4tKgkqu0dtU0t97oGIQdwY=; b=IBb8K4Gfv1Tl2/XB8G0CtNAoDvcKPQ91WdZBjFoU8KbUbviviSrEn9ZK7FESwHMYSF KYvJxYbBm4HJ4ZkqyGV8ujVFiafvoAE2h/V2FC3vDdx0uDDNK6zamWUHBsmxl4RFSYf+ dgqA+sIhbq0/zcQ/B7M4RMfqbXMnWLXqCwwTVaVqGbT7jpWhyiPKcfvE5LJpxOWg40oZ QJsQOa2oDmmuEkFBceE9t9eiR58A9cnZFCLDd6/0RbrWH0zSdyeOW/CQeN6q+xNkR5sk V1G7qdNo5JiZqhXsIPkMb+y7MH//Wr1UpmkhWo00NYJQ0OCfrIBfSgf1OoIR7W7t4KlY wRfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=xYRKuwvU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si6644492plo.73.2022.01.21.16.16.53; Fri, 21 Jan 2022 16:17:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=xYRKuwvU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378045AbiATWSF (ORCPT + 99 others); Thu, 20 Jan 2022 17:18:05 -0500 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:4945 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347534AbiATWSE (ORCPT ); Thu, 20 Jan 2022 17:18:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1642717084; x=1674253084; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=CbvFbjQfwDtoDzlP5NcZT4tKgkqu0dtU0t97oGIQdwY=; b=xYRKuwvUIrlHTGlMPStCkSHdnh4xmwHmE14gYvnvG7hOSU4sXlyrfULh vzJQ3iMMAZbAxgQdXb5AsCbXb2FpdGFKOnCeo8GNnqOtWVIvh4YC6zakP 9bdNeqtaVYsaU0chq7gPq/1zYbfEuFJgVW+XXw2KiyKtKDOa9E6G3GGr9 o=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 20 Jan 2022 14:18:03 -0800 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 14:18:01 -0800 Received: from [10.110.122.217] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 20 Jan 2022 14:18:02 -0800 Subject: Re: [PATCH 3/3] input: misc: pm8941-pwrkey: avoid potential null pointer dereference To: Anjelique Melendez , CC: , , , , , , References: <20220120204132.17875-1-quic_amelende@quicinc.com> <20220120204132.17875-4-quic_amelende@quicinc.com> From: Trilok Soni Message-ID: <88e7a6c5-c94e-0b65-173d-5f21109e216e@quicinc.com> Date: Thu, 20 Jan 2022 14:18:01 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220120204132.17875-4-quic_amelende@quicinc.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/20/2022 12:41 PM, Anjelique Melendez wrote: > From: David Collins > > Add a null check for the pwrkey->data pointer after it is assigned > in pm8941_pwrkey_probe(). This avoids a potential null pointer > dereference when pwrkey->data->has_pon_pbs is accessed later in > the probe function. > > Change-Id: I589c4851e544d79a1863fd110b32a0b45ac03caf > Signed-off-by: David Collins > Signed-off-by: Anjelique Melendez > --- > drivers/input/misc/pm8941-pwrkey.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c > index 0ce00736e695..ac08ed025802 100644 > --- a/drivers/input/misc/pm8941-pwrkey.c > +++ b/drivers/input/misc/pm8941-pwrkey.c > @@ -263,6 +263,10 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) > > pwrkey->dev = &pdev->dev; > pwrkey->data = of_device_get_match_data(&pdev->dev); > + if (!pwrkey->data) { > + dev_err(&pdev->dev, "match data not found\n"); > + return -ENODEV; > + } > I don't understand why this patch is 3rd in the series. Isn't it independent from the debounce time? If not, then why it is not fixed as part of the patch which adds this debounce time support? ---Trilok Soni