Commit:     e8973637bd49de225130f9c04ceb388d48969d98
Parent:     c0d40335353e1c89c9c885e5af4d0be0f1a50483
Author:     Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 01:39:44 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 10:41:18 2008 -0800

    FB/S3C2410: check default_display parameter passed in platform data
    Ensure that the default display parameter passed in via the
    device's platform data is valid. It turns out when mach-bast.c
    was updated, the default_display was set outside of the display
    array bounds, causing a panic on startup.
    If the default_display is bigger than num_displays, then generate
    an error and refuse to initialise the driver.
    Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
    Cc: "Antonino A. Daplas" <[EMAIL PROTECTED]>
    Cc: Vincent Sanders <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/video/s3c2410fb.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index e63f536..71fa6ed 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -817,6 +817,12 @@ static int __init s3c24xxfb_probe(struct platform_device 
                return -EINVAL;
+       if (mach_info->default_display >= mach_info->num_displays) {
+               dev_err(&pdev->dev, "default is %d but only %d displays\n",
+                       mach_info->default_display, mach_info->num_displays);
+               return -EINVAL;
+       }
        display = mach_info->displays + mach_info->default_display;
        irq = platform_get_irq(pdev, 0);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to