[PATCH] USB: usbatm kcalloc cleanup you seem to have applied the original, not the new improved one with whiter teeth that uses kcalloc instead of kmalloc + memset. Here's a patch that goes on top of the one you applied.
Signed-off-by: Duncan Sands <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- commit f0706930091902641929f2229bfb106144782c94 tree 64618963505fcf4413b95b95bda8efb572ba2c9c parent 843c944fb86e5e31ee7b319172e657ea22301322 author Duncan Sands <[EMAIL PROTECTED]> Sat, 28 May 2005 22:06:20 +0200 committer Greg Kroah-Hartman <[EMAIL PROTECTED]> Mon, 27 Jun 2005 14:43:58 -0700 drivers/usb/atm/usbatm.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -949,7 +949,6 @@ int usbatm_usb_probe(struct usb_interfac struct usb_device *usb_dev = interface_to_usbdev(intf); struct usbatm_data *instance; char *buf; - size_t instance_size = sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs); int error = -ENOMEM; int i, length; int need_heavy; @@ -961,14 +960,12 @@ int usbatm_usb_probe(struct usb_interfac intf->altsetting->desc.bInterfaceNumber); /* instance init */ - instance = kmalloc(instance_size, GFP_KERNEL); + instance = kcalloc(1, sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs), GFP_KERNEL); if (!instance) { dev_dbg(dev, "%s: no memory for instance data!\n", __func__); return -ENOMEM; } - memset(instance, 0, instance_size); - /* public fields */ instance->driver = driver; ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel