Skip to contentSkip to conversation

media: mediatek: vcodec: Return NULL if no vdec_fb is found

PATCH Superseded Irui Wang 2 participants 2 messages Jul 3, 2023 – Jul 5, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Irui Wang

author
#0 lore raw

PATCH v2 1/1 media: mediatek: vcodec: Return NULL if no vdec_fb is found

"fb_use_list" is used to store used or referenced frame buffers for vp9 stateful decoder. "NULL" should be returned when getting target frame buffer failed from "fb_use_list", not a random unexpected one.

---
changed with v1:
- remove the added flag variable.
- update commit message.

---
 drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c +3 -2
index 70b8383f7c8e..a27a109d8d14 100644
@@ -226,10 +226,11 @@ static struct vdec_fb *vp9_rm_from_fb_use_list(struct vdec_vp9_inst
 		if (fb->base_y.va == addr) {
 			list_move_tail(&node->list,
 				       &inst->available_fb_node_list);
-			break;
+			return fb;
 		}
 	}
-	return fb;
+
+	return NULL;
 }
 
 static void vp9_add_to_fb_free_list(struct vdec_vp9_inst *inst,
Signature · 1 line
2.18.0
#1 lore raw

Il 03/07/23 05:59, Irui Wang ha scritto:

Quoted 5 lines

"fb_use_list" is used to store used or referenced frame buffers for vp9 stateful decoder. "NULL" should be returned when getting target frame buffer failed from "fb_use_list", not a random unexpected one.

This commit needs a Fixes tag. Please add the relevant one and resend.

Regards,
Angelo

Quoted 27 lines

---
changed with v1:
- remove the added flag variable.
- update commit message.

---
  drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c +3 -2
index 70b8383f7c8e..a27a109d8d14 100644
@@ -226,10 +226,11 @@ static struct vdec_fb *vp9_rm_from_fb_use_list(struct vdec_vp9_inst
  		if (fb->base_y.va == addr) {
  			list_move_tail(&node->list,
  				       &inst->available_fb_node_list);
-			break;
+			return fb;
  		}
  	}
-	return fb;
+
+	return NULL;
  }
 
  static void vp9_add_to_fb_free_list(struct vdec_vp9_inst *inst,