2010-11-08 11:21:34

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc

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.


2010-11-08 16:00:06

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc

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

2010-11-08 16:59:04

by Luben Tuikov

[permalink] [raw]
Subject: Re: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc

--- On Mon, 11/8/10, Matthew Wilcox <[email protected]> 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?