OMAP: cs should be positive in gpmc_cs_free()
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · * [email protected] <[email protected]> [091117 14:39]:
From: Roel Kluin <[email protected]>
The index `cs' is signed, test whether it is negative before we release gpmc_cs_mem[cs].
I've added this too to omap-fixes and will send to Linus.
Regards,
Tony
Quoted 22 lines
Signed-off-by Roel Kluin <[email protected]>Acked-by Tony Lindgren <[email protected]>Cc Russell King <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
arch/arm/mach-omap2/gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -puN
arch/arm/mach-omap2/gpmc.c~omap-cs-should-be-positive-in-gpmc_cs_freearch/arm/mach-omap2/gpmc.carch/arm/mach-omap2/gpmc.c renamed from arch/arm/mach-omap2/gpmc.c~omap-cs-should-be-positive-in-gpmc_cs_free +1
-1@@ -405,7 +405,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);_