media: common: videobuf2: fix heap alloc result check

Change-Id: I85529c10e819fcdc026923bcfb3e6664cc12f6d2
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2022-04-11 17:48:58 +08:00
committed by Tao Huang
parent 1e2fd94076
commit 6a2cb4bacc

View File

@@ -113,7 +113,7 @@ static int vb2_cma_sg_alloc_contiguous(struct vb2_cma_sg_buf *buf)
page = cma_alloc(dev_get_cma_area(buf->dev), buf->num_pages,
get_order(buf->size), GFP_KERNEL);
}
if (!page) {
if (IS_ERR_OR_NULL(page)) {
pr_err("%s: cma_en:%d alloc pages fail\n", __func__, cma_en);
return -ENOMEM;
}