Re: [PATCH] SCSI, pmcraid: Fix kmalloc() argument order inpmcraid_chr_ioctl()

From: Jesper Juhl
Date: Mon Oct 24 2011 - 19:09:27 EST


On Tue, 25 Oct 2011, richard -rw- weinberger wrote:

> On Tue, Oct 25, 2011 at 12:54 AM, Dave Jones <davej@xxxxxxxxxx> wrote:
> > On Tue, Oct 25, 2011 at 12:50:08AM +0200, richard -rw- weinberger wrote:
> >
> >  > BTW: What about a checkpatch.pl rule to detect such a misuse of kmalloc()?
> >  > We could grep for "k[mzc]alloc(GFP_".
> >
> > Make sure to ignore bio_kmalloc (which has reverse argument order to kmalloc, ugh)
> >
>
> Hmmm, maybe we should "fix" the argument order of bio_kmalloc().
> But as this function is exported we'd silently break some out-of-tree
> kernel modules....
>
Or we could fix it noisily by renaming the function kmalloc_bio() and
fixing the argument order. That will still break out-of-tree modules, but
at least it won't break them silently...

Or we could introduce kmalloc_bio() with fixed argument order, fix all
in-kernel users and mark bio_kmalloc() deprecated with a note that it'll
go away by 3.6 or thereabouts...
I'd be happy to prepare a patch series doing that if it's wanted...?

--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.