* [PATCH v1] drm/amdgpu: Fix ISP segfault in kernel v7.0
@ 2026-03-11 16:19 Pratap Nirujogi
2026-03-11 16:47 ` Mario Limonciello
0 siblings, 1 reply; 3+ messages in thread
From: Pratap Nirujogi @ 2026-03-11 16:19 UTC (permalink / raw)
To: amd-gfx, mlimonci, alexander.deucher, christian.koenig
Cc: rafael.j.wysocki, benjamin.chan, bin.du, king.li, Pratap Nirujogi,
Bin Du
Add NULL pointer checks for dev->type before accessing
dev->type->name in ISP genpd add/remove functions to
prevent kernel crashes.
This regression was introduced in v7.0 as the wakeup sources
are registered using physical device instead of ACPI device.
This led to adding wakeup source device as the first child of
AMDGPU device without initializing dev-type variable, and
resulted in segfault when accessed it in the amdgpu isp driver.
Fixes: 057edc58aa59 ("ACPI: PM: Register wakeup sources under physical devices")
Co-developed-by: Bin Du <Bin.Du@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
---
drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
index b3590b33cab9e..485ecdec96184 100644
--- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
@@ -129,7 +129,7 @@ static int isp_genpd_add_device(struct device *dev, void *data)
if (!pdev)
return -EINVAL;
- if (!dev->type->name) {
+ if (!dev->type || !dev->type->name) {
drm_dbg(&adev->ddev, "Invalid device type to add\n");
goto exit;
}
@@ -165,7 +165,7 @@ static int isp_genpd_remove_device(struct device *dev, void *data)
if (!pdev)
return -EINVAL;
- if (!dev->type->name) {
+ if (!dev->type || !dev->type->name) {
drm_dbg(&adev->ddev, "Invalid device type to remove\n");
goto exit;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] drm/amdgpu: Fix ISP segfault in kernel v7.0
2026-03-11 16:19 [PATCH v1] drm/amdgpu: Fix ISP segfault in kernel v7.0 Pratap Nirujogi
@ 2026-03-11 16:47 ` Mario Limonciello
2026-03-11 17:02 ` Nirujogi, Pratap
0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2026-03-11 16:47 UTC (permalink / raw)
To: Pratap Nirujogi, amd-gfx, mlimonci, alexander.deucher,
christian.koenig
Cc: rafael.j.wysocki, benjamin.chan, bin.du, king.li
On 3/11/26 11:19, Pratap Nirujogi wrote:
> Add NULL pointer checks for dev->type before accessing
> dev->type->name in ISP genpd add/remove functions to
> prevent kernel crashes.
>
> This regression was introduced in v7.0 as the wakeup sources
> are registered using physical device instead of ACPI device.
> This led to adding wakeup source device as the first child of
> AMDGPU device without initializing dev-type variable, and
> resulted in segfault when accessed it in the amdgpu isp driver.
>
> Fixes: 057edc58aa59 ("ACPI: PM: Register wakeup sources under physical devices")
> Co-developed-by: Bin Du <Bin.Du@amd.com>
Did this pass checkpatch? In order to use C-d-b this should have Bin's
S-o-b I would expect too. If it was just his original idea for the
issue and you implemented it a better tag would be Suggested-by.
> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
> index b3590b33cab9e..485ecdec96184 100644
> --- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
> @@ -129,7 +129,7 @@ static int isp_genpd_add_device(struct device *dev, void *data)
> if (!pdev)
> return -EINVAL;
>
> - if (!dev->type->name) {
> + if (!dev->type || !dev->type->name) {
> drm_dbg(&adev->ddev, "Invalid device type to add\n");
> goto exit;
> }
> @@ -165,7 +165,7 @@ static int isp_genpd_remove_device(struct device *dev, void *data)
> if (!pdev)
> return -EINVAL;
>
> - if (!dev->type->name) {
> + if (!dev->type || !dev->type->name) {
> drm_dbg(&adev->ddev, "Invalid device type to remove\n");
> goto exit;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] drm/amdgpu: Fix ISP segfault in kernel v7.0
2026-03-11 16:47 ` Mario Limonciello
@ 2026-03-11 17:02 ` Nirujogi, Pratap
0 siblings, 0 replies; 3+ messages in thread
From: Nirujogi, Pratap @ 2026-03-11 17:02 UTC (permalink / raw)
To: Mario Limonciello, Pratap Nirujogi, amd-gfx, mlimonci,
alexander.deucher, christian.koenig
Cc: rafael.j.wysocki, benjamin.chan, bin.du, king.li
On 3/11/2026 12:47 PM, Mario Limonciello wrote:
>
>
> On 3/11/26 11:19, Pratap Nirujogi wrote:
>> Add NULL pointer checks for dev->type before accessing
>> dev->type->name in ISP genpd add/remove functions to
>> prevent kernel crashes.
>>
>> This regression was introduced in v7.0 as the wakeup sources
>> are registered using physical device instead of ACPI device.
>> This led to adding wakeup source device as the first child of
>> AMDGPU device without initializing dev-type variable, and
>> resulted in segfault when accessed it in the amdgpu isp driver.
>>
>> Fixes: 057edc58aa59 ("ACPI: PM: Register wakeup sources under physical
>> devices")
>> Co-developed-by: Bin Du <Bin.Du@amd.com>
>
> Did this pass checkpatch? In order to use C-d-b this should have Bin's
> S-o-b I would expect too. If it was just his original idea for the
> issue and you implemented it a better tag would be Suggested-by.
>
I missed the warning checkpatch reported, will fix it in v2. Sure, will
use Suggested-by tag as well.
Thanks,
Pratap
>> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c b/drivers/gpu/
>> drm/amd/amdgpu/isp_v4_1_1.c
>> index b3590b33cab9e..485ecdec96184 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
>> @@ -129,7 +129,7 @@ static int isp_genpd_add_device(struct device
>> *dev, void *data)
>> if (!pdev)
>> return -EINVAL;
>> - if (!dev->type->name) {
>> + if (!dev->type || !dev->type->name) {
>> drm_dbg(&adev->ddev, "Invalid device type to add\n");
>> goto exit;
>> }
>> @@ -165,7 +165,7 @@ static int isp_genpd_remove_device(struct device
>> *dev, void *data)
>> if (!pdev)
>> return -EINVAL;
>> - if (!dev->type->name) {
>> + if (!dev->type || !dev->type->name) {
>> drm_dbg(&adev->ddev, "Invalid device type to remove\n");
>> goto exit;
>> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-11 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 16:19 [PATCH v1] drm/amdgpu: Fix ISP segfault in kernel v7.0 Pratap Nirujogi
2026-03-11 16:47 ` Mario Limonciello
2026-03-11 17:02 ` Nirujogi, Pratap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox