lkml.org 
[lkml]   [2005]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] release_resource() check for NULL resource
On Wed, Oct 05, 2005 at 12:31:07AM +0200, Bodo Eggert wrote:
> Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> > static int driver_init(void)
> > {
> > dev->resource1 = request_region(...);
> > if (!dev->resource1)
> > goto failed;
>
> > failed:
> > driver_release(dev);
>
> > static void driver_release(struct device * dev)
> > {
> > release_resource(dev->resource1);
> > release_resource(dev->resource2);
>
> If the dev struct* isn't properly initialized, it will try to free a random
> resource.

Fur christ sake, I've made this point several times in this thread and
it still seems to be missed. (or maybe it's just folks sloppy use of
English.)

release_resource does *not* free anything. It unregisters it from the
resource tree _only_.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-05 11:10    [W:0.102 / U:0.188 seconds]
©2003-2014 Jasper Spaans. Advertise on this site