From patchwork Sun Nov 1 13:18:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 56864 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA1D7iTn021743 for ; Sun, 1 Nov 2009 13:07:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752079AbZKANHL (ORCPT ); Sun, 1 Nov 2009 08:07:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751952AbZKANHL (ORCPT ); Sun, 1 Nov 2009 08:07:11 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:33978 "EHLO mail-ew0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbZKANHJ (ORCPT ); Sun, 1 Nov 2009 08:07:09 -0500 Received: by ewy28 with SMTP id 28so4101476ewy.18 for ; Sun, 01 Nov 2009 05:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=qo5Vk8UrFzIcpV+wK9lSeT6DgV2jEBaldhhibcGbQfc=; b=UyNZlWgpDwJvb2yd7dBaW15YdRMWUsffJDU0EvR7Vp1oAyhcEisVYUUn2CRYVFsHSs VNWkY8ZZ51wcfpSbgb87leYECdJtqjDrift8YNjWD0Vf4MLYeFKt1IAXpTdhhfSRXq1R BEiLUp/0gVSdb/jHJjEIbtc4u5jdNbnuDBxCY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=eRQHDMxfxR5nLKHmzvmfq+aDkjHLpNWmoBRzj7INQZVMXoLuYSJ8mqx7+I3WminQeK YBFkrpVqsPFf7kU4eL+0lxhLms3AyKPmWnKwAtmxLTYsny5Ss83iO1Yii5RVaWX29BCE 08sH62YakgAntDw7QCbQpJMT1NLmLwUNK9xIU= Received: by 10.216.87.194 with SMTP id y44mr2972253wee.204.1257080833401; Sun, 01 Nov 2009 05:07:13 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm13197686eyg.9.2009.11.01.05.07.12 (version=SSLv3 cipher=RC4-MD5); Sun, 01 Nov 2009 05:07:12 -0800 (PST) Message-ID: <4AED8A98.6040205@gmail.com> Date: Sun, 01 Nov 2009 14:18:16 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: "Tony Lindgren " , "linux-omap@vger.kernel.org" , Andrew Morton , LKML Subject: [PATCH] OMAP: Should cs be positive in gpmc_cs_free()? Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 1587682..c892a54 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -378,7 +378,7 @@ EXPORT_SYMBOL(gpmc_cs_request); void gpmc_cs_free(int cs) { spin_lock(&gpmc_mem_lock); - if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) { + if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) { printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); BUG(); spin_unlock(&gpmc_mem_lock);