mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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: ff8c5622f9
("media: rkvdec: Restore iommu addresses on errors")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Tested-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
8f5ae30d69
commit
6347dc7fb9
@ -1162,9 +1162,11 @@ static int rkvdec_probe(struct platform_device *pdev)
|
||||
if (iommu_get_domain_for_dev(&pdev->dev)) {
|
||||
rkvdec->empty_domain = iommu_paging_domain_alloc(rkvdec->dev);
|
||||
|
||||
if (!rkvdec->empty_domain)
|
||||
if (IS_ERR(rkvdec->empty_domain)) {
|
||||
rkvdec->empty_domain = NULL;
|
||||
dev_warn(rkvdec->dev, "cannot alloc new empty domain\n");
|
||||
}
|
||||
}
|
||||
|
||||
vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user