Commit ff67dbd5 authored by Qiu Wenbo's avatar Qiu Wenbo Committed by Hans de Goede
Browse files

platform/x86: ideapad-laptop: fix a NULL pointer dereference



The third parameter of dytc_cql_command should not be NULL since it will
be dereferenced immediately.

Fixes: ff36b0d9 ("platform/x86: ideapad-laptop: rework and create new ACPI helpers")
Signed-off-by: default avatarQiu Wenbo <qiuwenbo@kylinos.com.cn>
Acked-by: default avatarIke Panhc <ike.pan@canonical.com>
Link: https://lore.kernel.org/r/20210428050636.8003-1-qiuwenbo@kylinos.com.cn


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 6efb943b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -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_dytc_priv *dytc = container_of(pprof, struct ideapad_dytc_priv, pprof);
	struct ideapad_private *priv = dytc->priv;
	struct ideapad_private *priv = dytc->priv;
	unsigned long output;
	int err;
	int err;


	err = mutex_lock_interruptible(&dytc->mutex);
	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 */
		/* 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),
		err = dytc_cql_command(priv, DYTC_SET_COMMAND(DYTC_FUNCTION_MMC, perfmode, 1),
				       NULL);
				       &output);
		if (err)
		if (err)
			goto unlock;
			goto unlock;
	}
	}