Messages in this thread | | | Date | Sun, 14 May 2006 02:58:38 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH][resend] fix resource leak in pnp card_probe() |
| |
Keith Owens <kaos@ocs.com.au> wrote: > > >+ clink = pnp_alloc(sizeof(*clink)); > >+ if (!clink) > >+ return 0; > >+ clink->card = card; > >+ clink->driver = drv; > >+ clink->pm_state = PMSG_ON; > > Memory leak of clink on next test. > > >+ > >+ if (drv->probe(clink, id) >= 0) > >+ return 1; > >+ > >+ /* Recovery */ > >+ card_for_each_dev(card, dev) { > >+ if (dev->card_link == clink) > >+ pnp_release_card_device(dev); > > } > >+ kfree(clink); > > return 0; > > }
No, if ->probe succeeded, it took over control of the memory at *clink.
It's all rather twisty and quite undocumented. - 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/
| |