platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] platform/x86: ideapad-laptop: fix a NULL pointer dereference
       [not found] <20210428050636.8003-1-qiuwenbo@kylinos.com.cn>
@ 2021-04-30  8:45 ` Ike Panhc
  2021-05-11 11:39   ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Ike Panhc @ 2021-04-30  8:45 UTC (permalink / raw)
  To: Qiu Wenbo, hdegoede, mgross; +Cc: platform-driver-x86, linux-kernel

On 4/28/21 1:06 PM, Qiu Wenbo wrote:
> The third parameter of dytc_cql_command should not be NULL since it will
> be dereferenced immediately.
> 
> Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>

Fixes: ff36b0d953dc4 ("platform/x86: ideapad-laptop: rework and create new ACPI helpers")
Acked-by: Ike Panhc <ike.pan@canonical.com>

> ---
>  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;
>  	}
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: ideapad-laptop: fix a NULL pointer dereference
  2021-04-30  8:45 ` [PATCH] platform/x86: ideapad-laptop: fix a NULL pointer dereference Ike Panhc
@ 2021-05-11 11:39   ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-05-11 11:39 UTC (permalink / raw)
  To: Ike Panhc, Qiu Wenbo, mgross; +Cc: platform-driver-x86, linux-kernel

Hi,

On 4/30/21 10:45 AM, Ike Panhc wrote:
> On 4/28/21 1:06 PM, Qiu Wenbo wrote:
>> The third parameter of dytc_cql_command should not be NULL since it will
>> be dereferenced immediately.
>>
>> Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>
> 
> Fixes: ff36b0d953dc4 ("platform/x86: ideapad-laptop: rework and create new ACPI helpers")
> Acked-by: Ike Panhc <ike.pan@canonical.com>

Thank you I've added this to my review-hans branch with the 2 above
tags added. I'll also add this to my fixes branch and include it in
a future pdx86 fixes pull-req for Linus for 5.13.

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans



> 
>> ---
>>  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;
>>  	}
>>
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-11 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210428050636.8003-1-qiuwenbo@kylinos.com.cn>
2021-04-30  8:45 ` [PATCH] platform/x86: ideapad-laptop: fix a NULL pointer dereference Ike Panhc
2021-05-11 11:39   ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).