summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorOsama Abdelkader <osama.abdelkader@gmail.com>2026-07-24 19:26:20 +0200
committerSteven Price <steven.price@arm.com>2026-07-30 10:49:57 +0100
commit2b8f13d3c7e26c46c20d9e367904cf01729c88e6 (patch)
tree2c78f6a8182a9cb47d541f1ac050794dbbe2abdb /drivers/gpu
parentd6c075f797a672a6e3bd2fd44aee713801698ec2 (diff)
drm/panthor: skip zero-sized firmware sections
panthor_fw_load_section_entry() skips BO creation when the firmware section VA range is empty. If such a section is added to the firmware section list, section->mem is left as NULL. Later reload and unplug paths iterate over all firmware sections and dereference section->mem, which can lead to a NULL pointer dereference. Zero-sized firmware sections are valid, so accept them as no-op entries but skip adding them to the section list. Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block") Cc: stable@vger.kernel.org Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260724172621.63046-1-osama.abdelkader@gmail.com Signed-off-by: Steven Price <steven.price@arm.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/panthor/panthor_fw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index e45933e333b5..fa88b2f9da76 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -603,6 +603,9 @@ static int panthor_fw_load_section_entry(struct panthor_device *ptdev,
return -EINVAL;
}
+ if (!section_size)
+ return 0;
+
name_len = iter->size - iter->offset;
section = drmm_kzalloc(&ptdev->base, sizeof(*section), GFP_KERNEL);