public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: Should cs be positive in gpmc_cs_free()?
@ 2009-11-01 13:18 Roel Kluin
  2009-11-03 17:05 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-11-01 13:18 UTC (permalink / raw)
  To: Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org, Andrew Morton, LKML

The index `cs' is signed, test whether it is negative before
we release gpmc_cs_mem[cs].

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Found by code analysis, is it required?

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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-03 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-01 13:18 [PATCH] OMAP: Should cs be positive in gpmc_cs_free()? Roel Kluin
2009-11-03 17:05 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox