[Suggestion] drivers/usb/core: for u16, use stack allocation instead of kmalloc

2012-12-06 Thread Chen Gang
Hello Greg Kroah-Hartman: in drivers/usb/core/message.c: at line 943, status is kmalloc ( sizeof u16 ) at line 952, assign the value of status to data at line 953, free status. it is better to let u16 status instead of u16 *status = kmalloc thanks. gchen. 940 int

Re: [Suggestion] drivers/usb/core: for u16, use stack allocation instead of kmalloc

2012-12-06 Thread Peter Stuge
Chen Gang wrote: it is better to let u16 status instead of u16 *status = kmalloc .. 940 int usb_get_status(struct usb_device *dev, int type, int target, void *data) 941 { 942 int ret; 943 u16 *status = kmalloc(sizeof(*status), GFP_KERNEL); 944 945 if

Re: [Suggestion] drivers/usb/core: for u16, use stack allocation instead of kmalloc

2012-12-06 Thread Chen Gang
于 2012年12月06日 19:01, Peter Stuge 写道: Chen Gang wrote: it is better to let u16 status instead of u16 *status = kmalloc . 940 int usb_get_status(struct usb_device *dev, int type, int target, void *data) 941 { 942 int ret; 943 u16 *status = kmalloc(sizeof(*status),

Re: [Suggestion] drivers/usb/core: for u16, use stack allocation instead of kmalloc

2012-12-06 Thread Oliver Neukum
On Thursday 06 December 2012 18:51:25 Chen Gang wrote: Hello Greg Kroah-Hartman: in drivers/usb/core/message.c: at line 943, status is kmalloc ( sizeof u16 ) at line 952, assign the value of status to data at line 953, free status. it is better to let u16 status instead of u16

Re: [Suggestion] drivers/usb/core: for u16, use stack allocation instead of kmalloc

2012-12-06 Thread Chen Gang
于 2012年12月06日 19:32, Oliver Neukum 写道: On Thursday 06 December 2012 18:51:25 Chen Gang wrote: Hello Greg Kroah-Hartman: in drivers/usb/core/message.c: at line 943, status is kmalloc ( sizeof u16 ) at line 952, assign the value of status to data at line 953, free status. it is