From patchwork Thu Nov 15 15:58:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1750301 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6990EDF2AB for ; Thu, 15 Nov 2012 15:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768163Ab2KOP7O (ORCPT ); Thu, 15 Nov 2012 10:59:14 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:50096 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768077Ab2KOP7L (ORCPT ); Thu, 15 Nov 2012 10:59:11 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id qAFFxBpR006580; Thu, 15 Nov 2012 09:59:11 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAFFxBWk029504; Thu, 15 Nov 2012 09:59:11 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Thu, 15 Nov 2012 09:59:11 -0600 Received: from deskari.tieu.ti.com (h68-10.vpn.ti.com [172.24.68.10]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAFFx6ux025421; Thu, 15 Nov 2012 09:59:09 -0600 From: Tomi Valkeinen To: Archit Taneja , Rob Clark CC: , , Tomi Valkeinen Subject: [PATCH 02/32] OMAPDSS: DPI: fix crash with dpi_verify_dsi_pll() Date: Thu, 15 Nov 2012 17:58:10 +0200 Message-ID: <1352995120-3288-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1352995120-3288-1-git-send-email-tomi.valkeinen@ti.com> References: <1352995120-3288-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org If the DSI support has not been compiled in or the SoC doesn't have DSI hardware, dpi_get_dsidev() returns NULL. This NULL is passed to dpi_verify_dsi_pll() causing a crash. The bug was added with commit 0e8276ef75f5c7811b038d1d23b2b42c16efc5ac (OMAPDSS: DPI: always use DSI PLL if available). Fix this by checking if dsidev is NULL before calling dpi_verify_dsi_pll(). Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 1e103b3..c109fa6 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -412,7 +412,7 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev) */ dsidev = dpi_get_dsidev(dssdev->channel); - if (dpi_verify_dsi_pll(dsidev)) { + if (dsidev && dpi_verify_dsi_pll(dsidev)) { dsidev = NULL; DSSWARN("DSI PLL not operational\n"); }