Re: [PATCH] checkpatch: Add devres_alloc() to allocation functions

From: Bui Duc Phuc

Date: Tue Aug 11 2026 - 23:52:07 EST


Hi Joe,

Thank you for your review.

>
> OK, are you also updating the 2 existing instances where
> there is an OOM message?
>
> -----------
> drivers/thermal/thermal_hwmon.c: ptr = devres_alloc(devm_thermal_hwmon_release, sizeof(*ptr),
> drivers/thermal/thermal_hwmon.c- GFP_KERNEL);
> drivers/thermal/thermal_hwmon.c- if (!ptr) {
> drivers/thermal/thermal_hwmon.c- dev_warn(dev, "Failed to allocate device resource data\n");
> drivers/thermal/thermal_hwmon.c- return -ENOMEM;
> drivers/thermal/thermal_hwmon.c- }
> -----------
> drivers/usb/phy/phy.c: ptr = devres_alloc(devm_usb_phy_release2, sizeof(*ptr), GFP_KERNEL);
> drivers/usb/phy/phy.c- if (!ptr) {
> drivers/usb/phy/phy.c- dev_dbg(dev, "failed to allocate memory for devres\n");
> drivers/usb/phy/phy.c- goto err0;
> drivers/usb/phy/phy.c- }
> -----------
>
> What about devres_alloc_node? (there aren't any OOM messages)
>

I'll send a v2 patch series addressing your comments.

Best regards,
Phuc