RE: [PATCH v2] xhci: Allocate the td array and urb_priv together.

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

 



> From: David Cohen
> On Fri, Dec 20, 2013 at 09:26:35AM -0000, David Laight wrote:
> > > From: David Cohen
> > The effect of this change is really to remove the first allocation and
> > add 8 bytes (or maybe a pointer) to the start of the second one.
> > So it is extremely unlikely to fail when the old code would work.
> 
> Currently struct urb_priv has a dynamic array of pointers to struct
> xhci_td. You're replacing the pointer by structs itself. Now, instead of
> 2 kmallocs() (1 for urb_priv and another for size * xhci_td) we've 1
> kmalloc() with urb_priv + size * xhci_td.

You misread the old code.
The first malloc was for the header and 'n' pointers.
The second malloc was for 'n' copies of the structure.

	David


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux