[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1290554607.3647.12.camel@atlantis.mindbit.ro>
Date: Wed, 24 Nov 2010 01:23:27 +0200
From: Ionut Nicu <ionut.nicu@...dbit.ro>
To: Ohad Ben-Cohen <ohad@...ery.com>
Cc: linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, akpm@...ux-foundation.org,
Greg KH <greg@...ah.com>, Tony Lindgren <tony@...mide.com>,
Benoit Cousson <b-cousson@...com>,
Grant Likely <grant.likely@...retlab.ca>,
Hari Kanigeri <h-kanigeri2@...com>, Suman Anna <s-anna@...com>,
Kevin Hilman <khilman@...prootsystems.com>,
Arnd Bergmann <arnd@...db.de>, Simon Que <sque@...com>,
"Krishnamoorthy, Balaji T" <balajitk@...com>
Subject: Re: [PATCH v2 2/4] drivers: hwspinlock: add OMAP implementation
Hi Ohad,
On Tue, 2010-11-23 at 17:38 +0200, Ohad Ben-Cohen wrote:
> From: Simon Que <sque@...com>
>
> Add hwspinlock support for the OMAP4 Hardware Spinlock device.
>
<snip>
> +
> + io_base = ioremap(res->start, resource_size(res));
> + if (!io_base) {
> + ret = -ENOMEM;
> + goto free_state;
> + }
> +
> + /* Determine number of locks */
> + i = readl(io_base + SYSSTATUS_OFFSET);
> + i >>= SPINLOCK_NUMLOCKS_BIT_OFFSET;
> +
> + /* exactly one of the four least significant bits must be 1 */
> + if (!i || !is_power_of_2(i) || i > 8) {
> + ret = -EINVAL;
> + goto iounmap_base;
> + }
> +
At iounmap_base you unmap state->io_base, but that's set only after this
check. You should probably iounmap(io_base).
Regards,
Ionut.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists