lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 08 May 2007 16:17:06 +0200
From:	Rene Herman <rene.herman@...il.com>
To:	Pekka Enberg <penberg@...helsinki.fi>
CC:	Andrew Morton <akpm@...l.org>, Jens Axboe <jens.axboe@...cle.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: New Mitsumi legacy CD-ROM driver

On 05/08/2007 03:53 PM, Pekka Enberg wrote:

>> +static int __mitsumi_read_toc(struct mitsumi_cdrom *mcd)
>> +{
>> +       int tracks = mcd->header.cdth_trk1 - mcd->header.cdth_trk0 + 1;
>> +       int retries;
>> +       int err = 0;
>> +
>> +       kfree(mcd->toc);
>> +
>> +       mcd->toc = kzalloc(tracks * sizeof *mcd->toc, GFP_KERNEL);
> 
> Perhaps we should use krealloc() + memset() here?

Earlier I had a patch lined up that checked the previous number of tracks 
against the current number and only freed the TOC array when they were not 
the same. The majority case is a data CD with one TOC entry meaning we just 
reuse the entry. You then have to keep the previous number of tracks though 
and it seemed a little pointless so I dropped it.

Another option is using a linked list for the TOC and reusing or allocating 
nodes upon reading the actual entry from the Q channel and freeing the rest 
when we got them all. Also seemed overly complex and the CDROMREADTOCENTRY 
gets slower ;-)

I admit my DOS inspired dislike of realloc() is largely pointless these days 
but, err... "E426: tag not found: krealloc". Would you perhaps like the 
list? Or the if (tracks != mcd->tracks) thing?

Rene.

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ