Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1c1cc66 authored by Sachin Kamat's avatar Sachin Kamat Committed by Mauro Carvalho Chehab
Browse files

[media] s5p-mfc: Add NULL check for allocated buffer



In certain cases, dma_alloc_coherent returns NULL. Add check for
NULL pointer.

Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4130eabc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev)
	dev->fw_virt_addr = dma_alloc_coherent(dev->mem_dev_l, dev->fw_size,
					&dev->bank1, GFP_KERNEL);

	if (IS_ERR(dev->fw_virt_addr)) {
	if (IS_ERR_OR_NULL(dev->fw_virt_addr)) {
		dev->fw_virt_addr = NULL;
		mfc_err("Allocating bitprocessor buffer failed\n");
		return -ENOMEM;