Re: [PATCH] platform/x86: thinkpad_acpi: skip invalid fan speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 10/19/22 21:47, Jelle van der Waa wrote:
> 65535 is most likely an invalid read.
> 
> Signed-off-by: Jelle van der Waa <jvanderwaa@xxxxxxxxxx>

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


> 
> ---
> 
> Cc: Mark Pearson <markpearson@xxxxxxxxxx>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 6a823b850a77..20e5c043a8e8 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -263,6 +263,8 @@ enum tpacpi_hkey_event_t {
>  #define TPACPI_DBG_BRGHT	0x0020
>  #define TPACPI_DBG_MIXER	0x0040
>  
> +#define FAN_NOT_PRESENT		65535
> +
>  #define strlencmp(a, b) (strncmp((a), (b), strlen(b)))
>  
>  
> @@ -8876,7 +8878,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
>  			/* Try and probe the 2nd fan */
>  			tp_features.second_fan = 1; /* needed for get_speed to work */
>  			res = fan2_get_speed(&speed);
> -			if (res >= 0) {
> +			if (res >= 0 && speed != FAN_NOT_PRESENT) {
>  				/* It responded - so let's assume it's there */
>  				tp_features.second_fan = 1;
>  				tp_features.second_fan_ctl = 1;




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux