Skip to contentSkip to conversation

drm/vkms: check plane_composer->map[0] before using it

PATCH Superseded Tales Lelo da Aparecida 3 participants 4 messages Apr 12, 2022 – Apr 14, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/vkms: check plane_composer->map[0] before using it

Hello, I'm interested in collaborating with VKMS, please let me know if there's anything that I could better.

Tales Lelo da Aparecida (1):
drm/vkms: check plane_composer->map[0] before using it

 drivers/gpu/drm/vkms/vkms_composer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/1 drm/vkms: check plane_composer->map[0] before using it

Fix a copypasta error, which resulted in checking repeatedly if the primary_composer->map[0] was null, instead of checking each plane_composer while composing planes.

---
 drivers/gpu/drm/vkms/vkms_composer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_composer.c +1 -1
index c6a1036bf2ea..b47ac170108c 100644
@@ -157,7 +157,7 @@ static void compose_plane(struct vkms_composer *primary_composer,
 	void *vaddr;
 	void (*pixel_blend)(const u8 *p_src, u8 *p_dst);
 
-	if (WARN_ON(iosys_map_is_null(&primary_composer->map[0])))
+	if (WARN_ON(iosys_map_is_null(&plane_composer->map[0])))
 		return;
 
 	vaddr = plane_composer->map[0].vaddr;
Signature · 1 line
2.35.1
#3 lore raw
In reply to Tales Lelo da Aparecida
Quoted 5 lines · Tales Lelo da Aparecida

Fix a copypasta error, which resulted in checking repeatedly if the primary_composer->map[0] was null, instead of checking each plane_composer while composing planes.

Hi Tales,

Nice catch!

I suggest you detail this issue with more information. The caller of compose_plane() already checks primary_composer->map. In constrast, plane_composer->map is never verified here before handling. Also, add the 'Fixes' tag pointing to the commit that introduced this issue.

Can you send a next version addressing these suggestions and already adding Andre's reviewed-by tag?

Thanks for your patch.

Melissa

Quoted 20 lines
---
 drivers/gpu/drm/vkms/vkms_composer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_composer.c +1 -1
index c6a1036bf2ea..b47ac170108c 100644
@@ -157,7 +157,7 @@ static void compose_plane(struct vkms_composer *primary_composer,
 	void *vaddr;
 	void (*pixel_blend)(const u8 *p_src, u8 *p_dst);
 
-	if (WARN_ON(iosys_map_is_null(&primary_composer->map[0])))
+	if (WARN_ON(iosys_map_is_null(&plane_composer->map[0])))
 		return;
 
 	vaddr = plane_composer->map[0].vaddr;
Signature · 1 line
2.35.1