Skip to content

Commit c949daf

Browse files
pelwellpopcornmix
authored andcommitted
staging/bcm2835-isp: Fix cleanup after init fail
bcm2835_isp_remove is called on an initialisation failure, but at that point the drvdata hasn't been set. This causes a crash when e.g. using the cutdown firmware (gpu_mem=16). Move platform_set_drvdata before the instance probing loop to avoid the problem. See: #4774 Signed-off-by: Phil Elwell <[email protected]>
1 parent a5110af commit c949daf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,14 +1776,15 @@ static int bcm2835_isp_probe(struct platform_device *pdev)
17761776
if (!bcm2835_isp_instances)
17771777
return -ENOMEM;
17781778

1779+
platform_set_drvdata(pdev, bcm2835_isp_instances);
1780+
17791781
for (i = 0; i < BCM2835_ISP_NUM_INSTANCES; i++) {
17801782
ret = bcm2835_isp_probe_instance(pdev,
17811783
&bcm2835_isp_instances[i], i);
17821784
if (ret)
17831785
goto error;
17841786
}
17851787

1786-
platform_set_drvdata(pdev, bcm2835_isp_instances);
17871788
dev_info(&pdev->dev, "Loaded V4L2 %s\n", BCM2835_ISP_NAME);
17881789
return 0;
17891790

0 commit comments

Comments
 (0)