Re: [PATCH 2/3] hwmon: lenovo-ec-sensors: Fix NULL pointer dereference when DMI match fails

From: Kean Ren

Date: Wed May 20 2026 - 01:52:20 EST


Hi Guenter,

Thank you for the review!

>> Remove all five manual release_region() calls that are now handled
>> automatically, and drop the unnecessary braces on the single-statement
>> blocks that previously contained them.
>
> [Severity: Medium]
> Is this description accurate? The patch diff shows that only four
> release_region() calls were removed.
>
>>As far as I can see there are only four calls in the code. Description
>>problem ?
Yes, you are right, thanks for your point out, I will update it.

>> @@ -541,7 +541,6 @@ static int lenovo_ec_probe(struct platform_device *pdev)
>> (inb_p(MCHP_EMI0_EC_DATA_BYTE1) != 'C') &&
>> (inb_p(MCHP_EMI0_EC_DATA_BYTE2) != 'H') &&
>> (inb_p(MCHP_EMI0_EC_DATA_BYTE3) != 'P')) {
>> - release_region(IO_REGION_START, IO_REGION_LENGTH);
>> return -ENODEV;
>> }
>
> [Severity: Medium]
> This isn't a bug, but could these curly braces be removed? The commit
> message mentions dropping the unnecessary braces on the single-statement
> blocks, but they appear to have been left intact here.
>
>>Hmm, yes, the description does not match the code changes. Please drop
>>the now unnecessary {}.
Thanks, you are right, it is unnecessary {}, I have removed it in the V2 2/2,
Please review it. Anyway, I will update the next version V3 that will
include all the modify which kindly pointed out from your review.

Thanks,
Kean