Browse Source

video: driver: skip zero length internal buffers allocation

Few internal buffers size can be zero based on configuration
(such as BIN buffers size is zero for interlace bitstream)
and hence skip allocation instead of returning error.

Change-Id: Id157115d8d6eb3f64154f3b18ec3843f289164ef
Signed-off-by: Maheshwar Ajja <[email protected]>
Maheshwar Ajja 4 năm trước cách đây
mục cha
commit
10ac73594f
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      driver/vidc/src/msm_vidc_driver.c

+ 3 - 5
driver/vidc/src/msm_vidc_driver.c

@@ -2403,11 +2403,9 @@ int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
 	if (!mappings)
 		return -EINVAL;
 
-	if (!buffers->size) {
-		i_vpr_e(inst, "%s: invalid buffer %#x\n",
-			__func__, buffer_type);
-		return -EINVAL;
-	}
+	if (!buffers->size)
+		return 0;
+
 	buffer = kzalloc(sizeof(struct msm_vidc_buffer), GFP_KERNEL);
 	if (!buffer) {
 		i_vpr_e(inst, "%s: buf alloc failed\n", __func__);