Skip to contentSkip to conversation

usb_control_msg and non-dma buffers

DISCUSSION Guenter Roeck 2 participants 2 messages Oct 14, 2013 Watchdog device drivers

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

Hi all,

I am getting the following smatch error in drivers/watchdog/pcwd_usb.c:

drivers/watchdog/pcwd_usb.c:257 usb_pcwd_send_command() error: doing dma on the stack (buf)

This is from a call to usb_control_msg().

Is this a false positive or a real problem that needs to be fixed ?

Thanks,
Guenter

#1 lore raw
Quoted 9 lines · Guenter Roeck

Hi all,

I am getting the following smatch error in drivers/watchdog/pcwd_usb.c:

drivers/watchdog/pcwd_usb.c:257 usb_pcwd_send_command() error: doing dma on the stack (buf)

This is from a call to usb_control_msg().

Is this a false positive or a real problem that needs to be fixed ?

It is a real problem that must be fixed.

You can't send USB data off of the stack and expect the driver to work on all controllers and platforms.

thanks,

greg k-h