Skip to content

Commit 3ec9b52

Browse files
committed
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 d45d9fd commit 3ec9b52

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
@@ -1774,14 +1774,15 @@ static int bcm2835_isp_probe(struct platform_device *pdev)
17741774
if (!bcm2835_isp_instances)
17751775
return -ENOMEM;
17761776

1777+
platform_set_drvdata(pdev, bcm2835_isp_instances);
1778+
17771779
for (i = 0; i < BCM2835_ISP_NUM_INSTANCES; i++) {
17781780
ret = bcm2835_isp_probe_instance(pdev,
17791781
&bcm2835_isp_instances[i], i);
17801782
if (ret)
17811783
goto error;
17821784
}
17831785

1784-
platform_set_drvdata(pdev, bcm2835_isp_instances);
17851786
dev_info(&pdev->dev, "Loaded V4L2 %s\n", BCM2835_ISP_NAME);
17861787
return 0;
17871788

0 commit comments

Comments
 (0)