Skip to content

Commit 51ca16f

Browse files
pelwellpopcornmix
authored andcommitted
video: bcm2708_fb: Disable FB if no displays found
If the firmware hasn't detected a display, the driver would assume one display was available, but because it had failed to retrieve the display size it would try to allocate a zero-sized buffer. Avoid the allocation failure by bailing out early if no display is found. See: #3598 Signed-off-by: Phil Elwell <[email protected]>
1 parent c790218 commit 51ca16f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/video/fbdev/bcm2708_fb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,10 +1092,9 @@ static int bcm2708_fb_probe(struct platform_device *dev)
10921092
* set one display
10931093
*/
10941094
if (ret || num_displays == 0) {
1095-
num_displays = 1;
10961095
dev_err(&dev->dev,
1097-
"Unable to determine number of FB's. Assuming 1\n");
1098-
ret = 0;
1096+
"Unable to determine number of FBs. Disabling driver.\n");
1097+
return -ENOENT;
10991098
} else {
11001099
fbdev->firmware_supports_multifb = 1;
11011100
}

0 commit comments

Comments
 (0)