From: Tomi Valkeinen Date: Thu, 7 Jan 2010 15:45:03 +0000 (+0200) Subject: OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded X-Git-Tag: v2.6.33-rc4~3^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=807a7515aea421f2b340140482ed4c8811c523c6;p=~shefty%2Frdma-dev.git OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded If the panel's probe had failed, omapfb would still go on, eventually crashing. A better fix would be to handle each display properly, and leaving just the failed display out. But that is a bigger change. Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index e61a75c3135..d17caef6915 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -2115,6 +2115,11 @@ static int omapfb_probe(struct platform_device *pdev) dssdev = NULL; for_each_dss_dev(dssdev) { omap_dss_get_device(dssdev); + if (!dssdev->driver) { + dev_err(&pdev->dev, "no driver for display\n"); + r = -EINVAL; + goto cleanup; + } fbdev->displays[fbdev->num_displays++] = dssdev; }