Skip to content

Commit 6347dc7

Browse files
Dan CarpenterHans Verkuil
authored andcommitted
media: rkvdec: Fix a NULL vs IS_ERR() bug in probe()
The iommu_paging_domain_alloc() function doesn't return NULL on error it returns error pointers. Update the check and then set ->empty_domain to NULL because the rest of the driver assumes it can be NULL. Fixes: ff8c562 ("media: rkvdec: Restore iommu addresses on errors") Signed-off-by: Dan Carpenter <[email protected]> Tested-by: Detlev Casanova <[email protected]> Signed-off-by: Nicolas Dufresne <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 8f5ae30 commit 6347dc7

File tree

1 file changed

+3
-1
lines changed
  • drivers/media/platform/rockchip/rkvdec

1 file changed

+3
-1
lines changed

drivers/media/platform/rockchip/rkvdec/rkvdec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,10 @@ static int rkvdec_probe(struct platform_device *pdev)
11621162
if (iommu_get_domain_for_dev(&pdev->dev)) {
11631163
rkvdec->empty_domain = iommu_paging_domain_alloc(rkvdec->dev);
11641164

1165-
if (!rkvdec->empty_domain)
1165+
if (IS_ERR(rkvdec->empty_domain)) {
1166+
rkvdec->empty_domain = NULL;
11661167
dev_warn(rkvdec->dev, "cannot alloc new empty domain\n");
1168+
}
11671169
}
11681170

11691171
vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));

0 commit comments

Comments
 (0)