Skip to content

Commit bf3932b

Browse files
dinghaoliugregkh
authored andcommitted
media: mx2_emmaprp: Fix memleak in emmaprp_probe
[ Upstream commit 21d387b ] When platform_get_irq() fails, we should release vfd and unregister pcdev->v4l2_dev just like the subsequent error paths. Fixes: d4e192c ("media: mx2_emmaprp: Check for platform_get_irq() error") Signed-off-by: Dinghao Liu <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 4f949a3 commit bf3932b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/media/platform/mx2_emmaprp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,11 @@ static int emmaprp_probe(struct platform_device *pdev)
852852
platform_set_drvdata(pdev, pcdev);
853853

854854
irq = platform_get_irq(pdev, 0);
855-
if (irq < 0)
856-
return irq;
855+
if (irq < 0) {
856+
ret = irq;
857+
goto rel_vdev;
858+
}
859+
857860
ret = devm_request_irq(&pdev->dev, irq, emmaprp_irq, 0,
858861
dev_name(&pdev->dev), pcdev);
859862
if (ret)

0 commit comments

Comments
 (0)