Amitkumar Karwar <amitkarwar@xxxxxxxxx> writes: > From: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx> > > In functions usb read register and usb write register, dynamic allocation > of 4 bytes is used. This is removed as it is unncessary for local variable > and for such small data. > > Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx> > Signed-off-by: Amitkumar Karwar <amit.karwar@xxxxxxxxxxxxxxxxxx> > --- > drivers/net/wireless/rsi/rsi_91x_usb.c | 18 ++++-------------- > 1 file changed, 4 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c > index 73b01a8..8eb7407 100644 > --- a/drivers/net/wireless/rsi/rsi_91x_usb.c > +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c > @@ -157,12 +157,8 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, > u16 *value, > u16 len) > { > - u8 *buf; > - int status = -ENOMEM; > - > - buf = kmalloc(0x04, GFP_KERNEL); > - if (!buf) > - return status; > + u8 buf[4]; > + int status; > > status = usb_control_msg(usbdev, > usb_rcvctrlpipe(usbdev, 0), Recently I got a patch to orinoco_usb which did exactly the opposite (unless I'm missing something): https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=2f6ae79cb04bb7f9b4be3f1c32b6fda35bf976bc The documentation for usb_control_msg() does not mention anything if it's possible to use stack memory, but AFAIU it's not possible to use stack memory with DMA. Can anyone clarify? -- Kalle Valo