On Thursday 27 December 2007, Paul Mundt wrote: > On Thu, Dec 27, 2007 at 01:26:47AM +0000, Adrian McMenamin wrote: > > +static int gdrom_get_last_session(struct cdrom_device_info *cd_info, > > struct cdrom_multisession *ms_info) +{ > > + int fentry, lentry, track, data, tocuse, err; > > + kfree(gd.toc); > > + gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL); > > Er, what? The size of this never changes, allocate it once, and just > overload it every time you step in to this function. There's no reason to > free it and reallocate every time. Shove it in your probe routine with > the rest of your kzallocs. since gd is a global, just dont declare toc as a pointer ... -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.
- References:
- [PATCH] SH/Dreamcast - add support for GD-Rom device
- From: "Adrian McMenamin" <[email protected]>
- Re: [PATCH] SH/Dreamcast - add support for GD-Rom device
- From: Paul Mundt <[email protected]>
- [PATCH] SH/Dreamcast - add support for GD-Rom device
- Prev by Date: [PATCH 9/9] ide: use ide_build_sglist() and ide_destroy_dmatable() in non-PCI host drivers
- Next by Date: Re: [BUG] at mm/slab.c:3320
- Previous by thread: Re: [PATCH] SH/Dreamcast - add support for GD-Rom device
- Next by thread: [PATCH] SH/Dreamcast - add support for GD-Rom device
- Index(es):