From patchwork Fri Jan 11 05:39:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 1963641 Return-Path: X-Original-To: patchwork-linux-omap@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 4AD1EDF2A2 for ; Fri, 11 Jan 2013 05:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702Ab3AKFi1 (ORCPT ); Fri, 11 Jan 2013 00:38:27 -0500 Received: from intranet.asianux.com ([58.214.24.6]:7154 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522Ab3AKFi0 (ORCPT ); Fri, 11 Jan 2013 00:38:26 -0500 Received: by intranet.asianux.com (Postfix, from userid 103) id CA80F18402C6; Fri, 11 Jan 2013 13:38:25 +0800 (CST) X-Spam-Score: -100.8 X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on intranet.asianux.com X-Spam-Level: X-Spam-Status: No, score=-100.8 required=5.0 tests=AWL,BAYES_00, RATWARE_GECKO_BUILD,USER_IN_WHITELIST autolearn=no version=3.1.9 Received: from [10.1.0.143] (unknown [219.143.36.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id 7994B1840242; Fri, 11 Jan 2013 13:38:25 +0800 (CST) Message-ID: <50EFA586.5010508@asianux.com> Date: Fri, 11 Jan 2013 13:39:18 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Santosh Shilimkar , tony@atomide.com, linux@arm.linux.org.uk CC: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: OMAP: Fix the use of uninitialized dma_lch_count References: <50EE9815.2080402@asianux.com> <50EE9C87.6060407@ti.com> In-Reply-To: <50EE9C87.6060407@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 'omap_dma_reserve_channels' when used is suppose to be from command. so, it alreay has value before 1st call of omap_system_dma_probe. and it will never be changed again during running (not from ioctl). but 'dma_lch_count' is zero before 1st call of omap_system_dma_probe. so it will be failed for omap_dma_reserve_channels, when 1st call. so, need use 'd->lch_count' instead of 'dma_lch_count' for judging. Signed-off-by: Chen Gang Signed-off-by: Santosh Shilimkar --- arch/arm/plat-omap/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 4136b20..e06c34b 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -2019,7 +2019,7 @@ static int omap_system_dma_probe(struct platform_device *pdev) errata = p->errata; if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels - && (omap_dma_reserve_channels <= dma_lch_count)) + && (omap_dma_reserve_channels < d->lch_count)) d->lch_count = omap_dma_reserve_channels; dma_lch_count = d->lch_count;