linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
@ 2010-10-27 20:22 Luben Tuikov
  2010-11-08 11:21 ` Matthew Wilcox
  0 siblings, 1 reply; 7+ messages in thread
From: Luben Tuikov @ 2010-10-27 20:22 UTC (permalink / raw)
  To: Greg KH, linux-usb, linux-kernel, linux-scsi, willy

"Be conservative in what you send, liberal in what
you accept." -- In the spirit of this adage, don't
send Command IUs with randomly filled in data in
the reserved fields. (Yes, this shows up on the
wire.)

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 drivers/usb/storage/uas.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 2054b1e..17e1820 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -294,7 +294,7 @@ static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 	if (!urb)
 		goto out;
 
-	iu = kmalloc(sizeof(*iu), gfp);
+	iu = kzalloc(sizeof(*iu), gfp);
 	if (!iu)
 		goto free;
 
@@ -325,7 +325,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 	if (len < 0)
 		len = 0;
 	len = ALIGN(len, 4);
-	iu = kmalloc(sizeof(*iu) + len, gfp);
+	iu = kzalloc(sizeof(*iu) + len, gfp);
 	if (!iu)
 		goto free;
 
@@ -660,7 +660,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
 			return -ENODEV;
 	}
 
-	devinfo = kmalloc(sizeof(struct uas_dev_info), GFP_KERNEL);
+	devinfo = kzalloc(sizeof(struct uas_dev_info), GFP_KERNEL);
 	if (!devinfo)
 		return -ENOMEM;
 
-- 
1.7.0.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
  2010-10-27 20:22 [PATCH] [USB] UAS: Use kzalloc instead of kmalloc Luben Tuikov
@ 2010-11-08 11:21 ` Matthew Wilcox
  2010-11-08 15:55   ` Greg KH
  2010-11-08 16:59   ` Luben Tuikov
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Wilcox @ 2010-11-08 11:21 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: Greg KH, linux-usb, linux-kernel, linux-scsi

On Wed, Oct 27, 2010 at 01:22:22PM -0700, Luben Tuikov wrote:
> "Be conservative in what you send, liberal in what
> you accept." -- In the spirit of this adage, don't
> send Command IUs with randomly filled in data in
> the reserved fields. (Yes, this shows up on the
> wire.)

Applied, with a better changelog entry ...

> @@ -660,7 +660,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  			return -ENODEV;
>  	}
>  
> -	devinfo = kmalloc(sizeof(struct uas_dev_info), GFP_KERNEL);
> +	devinfo = kzalloc(sizeof(struct uas_dev_info), GFP_KERNEL);
>  	if (!devinfo)
>  		return -ENOMEM;
>  

Except for this hunk, which isn't an IU and doesn't go out on the wire.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
  2010-11-08 11:21 ` Matthew Wilcox
@ 2010-11-08 15:55   ` Greg KH
  2010-11-08 16:59   ` Luben Tuikov
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2010-11-08 15:55 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Luben Tuikov, linux-usb, linux-kernel, linux-scsi

On Mon, Nov 08, 2010 at 06:21:31AM -0500, Matthew Wilcox wrote:
> On Wed, Oct 27, 2010 at 01:22:22PM -0700, Luben Tuikov wrote:
> > "Be conservative in what you send, liberal in what
> > you accept." -- In the spirit of this adage, don't
> > send Command IUs with randomly filled in data in
> > the reserved fields. (Yes, this shows up on the
> > wire.)
> 
> Applied, with a better changelog entry ...

Applied to where?  Shouldn't these patches go into my tree that feeds
into linux-next?

We really don't want driver-specific trees floating around anywhere,
please push them to me if possible.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
  2010-11-08 11:21 ` Matthew Wilcox
  2010-11-08 15:55   ` Greg KH
@ 2010-11-08 16:59   ` Luben Tuikov
  1 sibling, 0 replies; 7+ messages in thread
From: Luben Tuikov @ 2010-11-08 16:59 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Greg KH, linux-usb, linux-kernel, linux-scsi

--- On Mon, 11/8/10, Matthew Wilcox <willy@linux.intel.com> wrote:
> On Wed, Oct 27, 2010 at 01:22:22PM
> -0700, Luben Tuikov wrote:
> > "Be conservative in what you send, liberal in what
> > you accept." -- In the spirit of this adage, don't
> > send Command IUs with randomly filled in data in
> > the reserved fields. (Yes, this shows up on the
> > wire.)
> 
> Applied, with a better changelog entry ...

"Better"? Where did you apply it? Your willy/uas.git doesn't show it (updated 3 months ago), neither do Greg's.

BTW, is it customary to change the change log?  What did you change? Do you mind sharing?

> > @@ -660,7 +660,7 @@ static int uas_probe(struct
> usb_interface *intf, const struct usb_device_id *id)
> >         
>     return -ENODEV;
> >      }
> >  
> > -    devinfo = kmalloc(sizeof(struct
> uas_dev_info), GFP_KERNEL);
> > +    devinfo = kzalloc(sizeof(struct
> uas_dev_info), GFP_KERNEL);
> >      if (!devinfo)
> >          return
> -ENOMEM;
> >  
> 
> Except for this hunk, which isn't an IU and doesn't go out
> on the wire.

Lol, no of course it doesn't, silly!

So help us understand: You've preserved all changes from kmalloc->kzalloc and left a single kmalloc alone. And your reason is that "*This* one doesn't go out on the wire?"

Wouldn't if have been more consistent (and harmless) to have changed all of them, just as the patch did?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
@ 2010-12-10 10:49 Luben Tuikov
  0 siblings, 0 replies; 7+ messages in thread
From: Luben Tuikov @ 2010-12-10 10:49 UTC (permalink / raw)
  To: Greg KH, linux-usb, linux-kernel, linux-scsi, willy

Patch retracted for this still-born driver. Instead please use superior uasp.c which was recently submitted.

--- On Wed, 10/27/10, Luben Tuikov <ltuikov@yahoo.com> wrote:

> From: Luben Tuikov <ltuikov@yahoo.com>
> Subject: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
> To: "Greg KH" <greg@kroah.com>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, willy@linux.intel.com
> Date: Wednesday, October 27, 2010, 1:22 PM
> "Be conservative in what you send,
> liberal in what
> you accept." -- In the spirit of this adage, don't
> send Command IUs with randomly filled in data in
> the reserved fields. (Yes, this shows up on the
> wire.)
> 
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> ---
>  drivers/usb/storage/uas.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/storage/uas.c
> b/drivers/usb/storage/uas.c
> index 2054b1e..17e1820 100644
> --- a/drivers/usb/storage/uas.c
> +++ b/drivers/usb/storage/uas.c
> @@ -294,7 +294,7 @@ static struct urb
> *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t
> gfp,
>      if (!urb)
>          goto out;
>  
> -    iu = kmalloc(sizeof(*iu), gfp);
> +    iu = kzalloc(sizeof(*iu), gfp);
>      if (!iu)
>          goto free;
>  
> @@ -325,7 +325,7 @@ static struct urb
> *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
>      if (len < 0)
>          len = 0;
>      len = ALIGN(len, 4);
> -    iu = kmalloc(sizeof(*iu) + len, gfp);
> +    iu = kzalloc(sizeof(*iu) + len, gfp);
>      if (!iu)
>          goto free;
>  
> @@ -660,7 +660,7 @@ static int uas_probe(struct
> usb_interface *intf, const struct usb_device_id *id)
>             
> return -ENODEV;
>      }
>  
> -    devinfo = kmalloc(sizeof(struct
> uas_dev_info), GFP_KERNEL);
> +    devinfo = kzalloc(sizeof(struct
> uas_dev_info), GFP_KERNEL);
>      if (!devinfo)
>          return -ENOMEM;
>  
> -- 
> 1.7.0.1
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
@ 2010-11-08 18:46 Luben Tuikov
  0 siblings, 0 replies; 7+ messages in thread
From: Luben Tuikov @ 2010-11-08 18:46 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Greg KH, linux-usb, linux-kernel, linux-scsi

--- On Mon, 11/8/10, Luben Tuikov <ltuikov@yahoo.com> wrote:
> --- On Mon, 11/8/10, Luben Tuikov
> <ltuikov@yahoo.com>
> wrote:
> > --- On Mon, 11/8/10, Matthew Wilcox
> > <willy@linux.intel.com>
> > wrote:
> > > On Wed, Oct 27, 2010 at 01:22:22PM
> > > -0700, Luben Tuikov wrote:
> > > > "Be conservative in what you send, liberal
> in
> > what
> > > > you accept." -- In the spirit of this
> adage,
> > don't
> > > > send Command IUs with randomly filled in
> data in
> > > > the reserved fields. (Yes, this shows up on
> the
> > > > wire.)
> > > 
> > > Applied, with a better changelog entry ...
> > 
> > "Better"? Where did you apply it? Your willy/uas.git
> > doesn't show it (updated 3 months ago), neither do
> Greg's.
> > 
> > BTW, is it customary to change the change log?  What
> > did you change? Do you mind sharing?
> 
> Matthew, could you reply-all here with your new, changed
> and
> modified change log?
> 
> I'd like you to be accountable to what and how you've
> changed the changelog HERE and not in a git three somewhere
> and have an open comparison to what your new change log is
> and what is says.
> 
> Mine, quoted above:
>   a) mentions an adage that's been around for 30 years
> at least,
>      in the UNIX/net field to which we
> adhere.
>   b) mentions (only!) the Command IU of making out on
> the wire
>      with stale system data of the
> memory used for it.
> 
> Could you please reconsider your professional integrity
> and
> submit the patch as is with the original log?

Matthew,

I did NOT Signed-off-by: with my name and email to a patch where you've changed both the change log and the diff.

Now, you have two options here:

a) commit the modified by you patches, {change log and diff}, AS YOUR OWN patches, removing the Signed-off-by: me line, OR

b) commit the patch, {change log and diff}, as I've posted it, thus preserving the Signed-off-by: me line.

A Signed-off-by: line is a digital signature, and we cannot have that under text (the change log) that that person didn't write or agree to.

I don't mind either a) or b), but if a) then we need to include this practice of changing the patch {change log and diff} by the maintainer and removing the Signed-off-by: line of the author of the patch in Documentation/development-process/ so that contributors to the kernel are aware of this practice.

> 
> > > > @@ -660,7 +660,7 @@ static int
> uas_probe(struct
> > > usb_interface *intf, const struct usb_device_id
> *id)
> > > >         
> > >     return -ENODEV;
> > > >      }
> > > >  
> > > > -    devinfo = kmalloc(sizeof(struct
> > > uas_dev_info), GFP_KERNEL);
> > > > +    devinfo = kzalloc(sizeof(struct
> > > uas_dev_info), GFP_KERNEL);
> > > >      if (!devinfo)
> > > >          return
> > > -ENOMEM;
> > > >  
> > > 
> > > Except for this hunk, which isn't an IU and
> doesn't go
> > out
> > > on the wire.
> > 
> > Lol, no of course it doesn't, silly!
> 
> And notice that /my/ change log doesn't claim that 
> uas_dev_info makes it out the wire. It only mentions that
> the Command IU makes it out the wire with stale data.
> 
> > 
> > So help us understand: You've preserved all changes
> from
> > kmalloc->kzalloc and left a single kmalloc alone.
> And
> > your reason is that "*This* one doesn't go out on the
> > wire?"
> > 
> > Wouldn't if have been more consistent (and harmless)
> to
> > have changed all of them, just as the patch did?
> > 
> >
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
@ 2010-11-08 17:50 Luben Tuikov
  0 siblings, 0 replies; 7+ messages in thread
From: Luben Tuikov @ 2010-11-08 17:50 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Greg KH, linux-usb, linux-kernel, linux-scsi

--- On Mon, 11/8/10, Luben Tuikov <ltuikov@yahoo.com> wrote:
> --- On Mon, 11/8/10, Matthew Wilcox
> <willy@linux.intel.com>
> wrote:
> > On Wed, Oct 27, 2010 at 01:22:22PM
> > -0700, Luben Tuikov wrote:
> > > "Be conservative in what you send, liberal in
> what
> > > you accept." -- In the spirit of this adage,
> don't
> > > send Command IUs with randomly filled in data in
> > > the reserved fields. (Yes, this shows up on the
> > > wire.)
> > 
> > Applied, with a better changelog entry ...
> 
> "Better"? Where did you apply it? Your willy/uas.git
> doesn't show it (updated 3 months ago), neither do Greg's.
> 
> BTW, is it customary to change the change log?  What
> did you change? Do you mind sharing?

Matthew, could you reply-all here with your new, changed and
modified change log?

I'd like you to be accountable to what and how you've changed the changelog HERE and not in a git three somewhere and have an open comparison to what your new change log is and what is says.

Mine, quoted above:
  a) mentions an adage that's been around for 30 years at least,
     in the UNIX/net field to which we adhere.
  b) mentions (only!) the Command IU of making out on the wire
     with stale system data of the memory used for it.

Could you please reconsider your professional integrity and
submit the patch as is with the original log?

> > > @@ -660,7 +660,7 @@ static int uas_probe(struct
> > usb_interface *intf, const struct usb_device_id *id)
> > >         
> >     return -ENODEV;
> > >      }
> > >  
> > > -    devinfo = kmalloc(sizeof(struct
> > uas_dev_info), GFP_KERNEL);
> > > +    devinfo = kzalloc(sizeof(struct
> > uas_dev_info), GFP_KERNEL);
> > >      if (!devinfo)
> > >          return
> > -ENOMEM;
> > >  
> > 
> > Except for this hunk, which isn't an IU and doesn't go
> out
> > on the wire.
> 
> Lol, no of course it doesn't, silly!

And notice that /my/ change log doesn't claim that 
uas_dev_info makes it out the wire. It only mentions that
the Command IU makes it out the wire with stale data.

> 
> So help us understand: You've preserved all changes from
> kmalloc->kzalloc and left a single kmalloc alone. And
> your reason is that "*This* one doesn't go out on the
> wire?"
> 
> Wouldn't if have been more consistent (and harmless) to
> have changed all of them, just as the patch did?
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-10 10:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 20:22 [PATCH] [USB] UAS: Use kzalloc instead of kmalloc Luben Tuikov
2010-11-08 11:21 ` Matthew Wilcox
2010-11-08 15:55   ` Greg KH
2010-11-08 16:59   ` Luben Tuikov
2010-11-08 17:50 Luben Tuikov
2010-11-08 18:46 Luben Tuikov
2010-12-10 10:49 Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).