Selaa lähdekoodia

Merge "video: driver: fix kw issue of pointer NULL checking"

qctecmdr 2 vuotta sitten
vanhempi
sitoutus
fdc186d299
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      driver/vidc/src/msm_vidc_memory_ext.c

+ 6 - 0
driver/vidc/src/msm_vidc_memory_ext.c

@@ -151,6 +151,12 @@ static int msm_vidc_memory_alloc_ext(struct msm_vidc_core *core, struct msm_vidc
 	}
 
 	heap = dma_heap_find(heap_name);
+	if (IS_ERR_OR_NULL(heap)) {
+		d_vpr_e("%s: dma heap %s find failed\n", __func__, heap_name);
+		heap = NULL;
+		rc = -ENOMEM;
+		goto error;
+	}
 	mem->dmabuf = dma_heap_buffer_alloc(heap, size, 0, 0);
 	if (IS_ERR_OR_NULL(mem->dmabuf)) {
 		d_vpr_e("%s: dma heap %s alloc failed\n", __func__, heap_name);