Re: [PATCH] buggered kmalloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 20, 2007 at 04:05:30PM -0400, Dave Jones wrote:
> On Fri, Jul 20, 2007 at 04:03:40PM +0100, Al Viro wrote:
>  > Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
>  > ---
>  > 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.

Or just run sparse before and after - all such places stand out immediately...
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux