Skip to content

Commit 670db0a

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 ec7f55b commit 670db0a

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
@@ -1104,10 +1104,9 @@ static int bcm2708_fb_probe(struct platform_device *dev)
11041104
* set one display
11051105
*/
11061106
if (ret || num_displays == 0) {
1107-
num_displays = 1;
11081107
dev_err(&dev->dev,
1109-
"Unable to determine number of FB's. Assuming 1\n");
1110-
ret = 0;
1108+
"Unable to determine number of FBs. Disabling driver.\n");
1109+
return -ENOENT;
11111110
} else {
11121111
fbdev->firmware_supports_multifb = 1;
11131112
}

0 commit comments

Comments
 (0)