Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3547146pxj; Mon, 24 May 2021 09:06:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMAgw7o9WVF1i+YARb+hdTZQQ4s9gkVdpYuCgVf01XYOWyUSMDJPQMwC7obkn4Hw12Xsas X-Received: by 2002:a02:5b85:: with SMTP id g127mr26554211jab.80.1621872398453; Mon, 24 May 2021 09:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872398; cv=none; d=google.com; s=arc-20160816; b=qW9qpcGy5IF3aSXWM8ZuAQZhwt3mxZBCTBaaI/vqFtg3/WW3Zz7DXjo+leiE2/bF3D woUjDt8JsL1c5x0JLoVvAuoaZXGWj5gYCfZn8h4524OJuUEyFXy70ZQUqHZq/+rA0D0Z YMnZNcOt7mT0tl/yX3Hl+DGUeWO07EOF0NGDk38aFrUbfKdUZfGm+y19B0YRQbkL66dG PjnfMdYFPKW4sETqeIQYKe5EcOgjgqKtoVBp/cjfh5bngcpanDL6QdWazxw29MeuZtkX nrSExLcb2tYG85sUUxsDYpSXi86Uev/rpaQCNe2ngIhBwXE9r6H7C4pDznokuCc5ek0q FPcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FqVXIf+8ZmR8glNxfw76NWcsUK24dGyBU87XcyXgxqg=; b=fUJL8ZCW26Z5+XhyLM3VvjIEUqqRUgvVo9e9M1fcgPf363nysBKidQPs0RwBclsDOI rBb94iUWpOxGPA+6BEv6xgOlL8Pnl/p9adWjfVk8w7/0sdm8EYvf8lSdMDO4t0+Cxi1N onatq65FEa18LHcF3Cy2t2/XCZ6kAXb8EfcSKM3E5qte29NEZzQPeN1wOYrhiv0wkSPR fMatK6yEVosYFtmifZJs/m7UIDj1Y2rkVB47lgTbsAjtWI0OEKuQYZQ3jW/UwyO+3vFp caCDS9+jLK+JrdBP1SrGl1NV5J/TiK+Qh0FA2tSWMpp2Usu9jRJLCMmoJkFpSzkIZddf neyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D5WdWmCw; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 138si12556379iob.20.2021.05.24.09.06.24; Mon, 24 May 2021 09:06:38 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=D5WdWmCw; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236656AbhEXQEd (ORCPT + 99 others); Mon, 24 May 2021 12:04:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:40482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234501AbhEXP5z (ORCPT ); Mon, 24 May 2021 11:57:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A515613D2; Mon, 24 May 2021 15:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871033; bh=p+L6IWdDWj3BuKlRYk3bfT3VrIjBfJfW1TbppQKKpR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5WdWmCwbw7M3eS+P248RRyqjTAHgYV+tskQap+Z18J6EhnDXKW4KmGsZC569utUw aXYfM6zr/VLAmWn3Kt8JtDdLAZQ7hXDgS4AZsAHvu2swqIflCKKbfnCqPGxtM8Ol9B GYIejW000AovG3gv9WaPZIjsEP/kXZIUV4DjZsVA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiu Wenbo , Ike Panhc , Hans de Goede , Sasha Levin Subject: [PATCH 5.12 008/127] platform/x86: ideapad-laptop: fix a NULL pointer dereference Date: Mon, 24 May 2021 17:25:25 +0200 Message-Id: <20210524152335.139344613@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiu Wenbo [ Upstream commit ff67dbd554b2aaa22be933eced32610ff90209dd ] The third parameter of dytc_cql_command should not be NULL since it will be dereferenced immediately. Fixes: ff36b0d953dc4 ("platform/x86: ideapad-laptop: rework and create new ACPI helpers") Signed-off-by: Qiu Wenbo Acked-by: Ike Panhc Link: https://lore.kernel.org/r/20210428050636.8003-1-qiuwenbo@kylinos.com.cn Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/ideapad-laptop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 6cb5ad4be231..8f871151f0cc 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -809,6 +809,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof, { struct ideapad_dytc_priv *dytc = container_of(pprof, struct ideapad_dytc_priv, pprof); struct ideapad_private *priv = dytc->priv; + unsigned long output; int err; err = mutex_lock_interruptible(&dytc->mutex); @@ -829,7 +830,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof, /* Determine if we are in CQL mode. This alters the commands we do */ err = dytc_cql_command(priv, DYTC_SET_COMMAND(DYTC_FUNCTION_MMC, perfmode, 1), - NULL); + &output); if (err) goto unlock; } -- 2.30.2