Re: [PATCH 2/3] hwmon: lenovo-ec-sensors: Fix NULL pointer dereference when DMI match fails
From: Guenter Roeck
Date: Wed May 20 2026 - 09:12:22 EST
On 5/19/26 22:52, Kean Ren wrote:
Hi Guenter,
Thank you for the review!
Yes, you are right, thanks for your point out, I will update it.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 ?
Thanks, you are right, it is unnecessary {}, I have removed it in the V2 2/2,@@ -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 {}.
I have seen that, but that patch only removes one of the now unnecessary {},
and they should be removed when they were made unnecessary (i.e., in this
patch).
Thanks,
Guenter