From patchwork Tue May 28 06:24:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afzal Mohammed X-Patchwork-Id: 2623031 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9BBF83FDBC for ; Tue, 28 May 2013 06:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933028Ab3E1GZY (ORCPT ); Tue, 28 May 2013 02:25:24 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:51618 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932989Ab3E1GZX (ORCPT ); Tue, 28 May 2013 02:25:23 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4S6Op35028166; Tue, 28 May 2013 01:24:51 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4S6Op4x028270; Tue, 28 May 2013 01:24:51 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 28 May 2013 01:24:51 -0500 Received: from psplinux063.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4S6OnJF003903; Tue, 28 May 2013 01:24:49 -0500 From: Afzal Mohammed To: , , CC: Tony Lindgren , Russell King Subject: [PATCH] ARM: OMAP2+: timer: initialize before using oh_name Date: Tue, 28 May 2013 11:54:48 +0530 Message-ID: <1369722288-15592-1-git-send-email-afzal@ti.com> X-Mailer: git-send-email 1.7.12 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org of_property_read_string_index(...,&oh_name) in omap_dm_timer_init_one does not alter the value of 'oh_name' even if the relevant function fails and as 'oh_name' in stack may have a non-zero value, it would be misunderstood by timer code that DT has specified "ti,hwmod" property for timer. 'oh_name' in this scenario would be a junk value, this would result in module not being enabled by hwmod API's for timer, and in turn crash. Signed-off-by: Afzal Mohammed Acked-by: Jon Hunter --- arch/arm/mach-omap2/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index f8b23b8..8e0c390 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -220,7 +220,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, int posted) { char name[10]; /* 10 = sizeof("gptXX_Xck0") */ - const char *oh_name; + const char *oh_name = NULL; struct device_node *np; struct omap_hwmod *oh; struct resource irq, mem;