lkml.org 
[lkml]   [2007]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] buggered kmalloc()
From
Date
On Fri, 2007-07-20 at 16:05 -0400, Dave Jones wrote:
> On Fri, Jul 20, 2007 at 04:03:40PM +0100, Al Viro wrote:
> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> > ---
> > diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
> > index aebcd5f..7829ab1 100644
> > --- a/drivers/scsi/iscsi_tcp.c
> > +++ b/drivers/scsi/iscsi_tcp.c
> > @@ -1885,7 +1885,7 @@ static int iscsi_tcp_get_addr(struct iscsi_conn *conn, struct socket *sock,
> > struct sockaddr_in *sin;
> > int rc = 0, len;
> >
> > - addr = kmalloc(GFP_KERNEL, sizeof(*addr));
> > + addr = kmalloc(sizeof(*addr), GFP_KERNEL);
> > if (!addr)
> > return -ENOMEM;
>
> This seems like something that would be trivial to check for in checkpatch.

and at runtime if we make a __GFP_VALID flag we add to all GFP_'s (and
is just a few high bits in a specific pattern) and check that inside
kmalloc.. since kmalloc is inline just about always it's a constant and
thus compiled out check..
--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org

-
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: 2007-07-20 23:39    [W:1.408 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site