Skip to content

Commit 331e06b

Browse files
Zhen Leimchehab
authored andcommitted
media: venus: hfi: fix return value check in sys_get_prop_image_version()
In case of error, the function qcom_smem_get() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d566e78 ("media: venus : hfi: add venus image info into smem") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 3836707 commit 331e06b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/platform/qcom/venus/hfi_msgs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ sys_get_prop_image_version(struct device *dev,
261261

262262
smem_tbl_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY,
263263
SMEM_IMG_VER_TBL, &smem_blk_sz);
264-
if (smem_tbl_ptr && smem_blk_sz >= SMEM_IMG_OFFSET_VENUS + VER_STR_SZ)
264+
if (!IS_ERR(smem_tbl_ptr) && smem_blk_sz >= SMEM_IMG_OFFSET_VENUS + VER_STR_SZ)
265265
memcpy(smem_tbl_ptr + SMEM_IMG_OFFSET_VENUS,
266266
img_ver, VER_STR_SZ);
267267
}

0 commit comments

Comments
 (0)