[PATCH] USB: kzalloc() conversion in drivers/usb/gadget
this patch converts drivers/usb to kzalloc usage. Compile tested with allyes config. I think there was a bug in drivers/usb/gadget/inode.c because it used sizeof(*data) for the kmalloc() and sizeof(data) for the memset(), since sizeof(data) just returns the size for a pointer. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
80b6ca4832
commit
7039f4224d
@@ -478,10 +478,9 @@ dummy_alloc_request (struct usb_ep *_ep, gfp_t mem_flags)
|
||||
return NULL;
|
||||
ep = usb_ep_to_dummy_ep (_ep);
|
||||
|
||||
req = kmalloc (sizeof *req, mem_flags);
|
||||
req = kzalloc(sizeof(*req), mem_flags);
|
||||
if (!req)
|
||||
return NULL;
|
||||
memset (req, 0, sizeof *req);
|
||||
INIT_LIST_HEAD (&req->queue);
|
||||
return &req->req;
|
||||
}
|
||||
|
Reference in New Issue
Block a user