Re: [PATCH] virt: vmgenid: Add Null check for device

From: Jason A. Donenfeld
Date: Wed Mar 19 2025 - 13:22:34 EST


On Wed, Mar 12, 2025 at 11:26:00PM -0500, Chenyuan Yang wrote:
> Not all devices have an ACPI companion fwnode, so device might be NULL.
> This is similar to the commit cd2fd6eab480
> ("platform/x86: int3472: Check for adev == NULL").
>
> Add a check for device not being set and return -ENODEV in that case to
> avoid a possible NULL pointer deref in vmgenid_add_acpi().

Is this causing a crash on some systems? What's happening here? "Not all
devices" - which ones, and why?

Jason