lkml.org 
[lkml]   [2005]   [Dec]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 10 Dec 2005 10:25:28 +0100
FromCornelia Huck <>
SubjectRe: [patch 14/17] s390: introduce struct channel_subsystem.
2005/12/10, Andrew Morton <akpm@osdl.org>:
> Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
> >
> > +     /* Setup css structure. */
> >  +    for (i = 0; i <= __MAX_CSSID; i++) {
> >  +            css[i] = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL);
> >  +            if (!css[i]) {
> >  +                    ret = -ENOMEM;
> >  +                    goto out_bus;
> >  +            }
> >  +            setup_css(i);
> >  +            ret = device_register(&css[i]->device);
> >  +            if (ret)
> >  +                    goto out_free;
> >  +    }
> >       css_init_done = 1;
> >
> >       ctl_set_bit(6, 28);
> >
> >       for_each_subchannel(__init_channel_subsystem, NULL);
> >       return 0;
> >  +out_free:
> >  +    kfree(css[i]);
> >   out_bus:
> >  +    while (i > 0) {
> >  +            i--;
> >  +            device_unregister(&css[i]->device);
> >  +    }
>
> I spy a memory leak.

Ugh, yes. Where has that release function gone? I'll send an
updated patch.

Cornelia
-
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-12-10 10:30    [W:0.358 / U:0.030 seconds]
©2003-2008 Jasper Spaans