Re: [RFC 2/5] USB: core: OTG Supplement Revision 2.0 updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 15 Dec 2010, Felipe Balbi wrote:

> >+{
> >+	int ret;
> >+	struct usb_bus *bus =
> >+		container_of(work, struct usb_bus, hnp_polling.work);
> >+	struct usb_device *udev = bus->root_hub->children[bus->otg_port - 1];
> >+	u8 *status = kmalloc(sizeof(*status), GFP_KERNEL);
> 
> how about:
> 
> u8 status;
> 
> and...
> 
> >+	if (!status)
> >+		return;
> >+
> >+	ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
> >+		USB_REQ_GET_STATUS, USB_DIR_IN | USB_RECIP_DEVICE,
> >+		0, OTG_STATUS_SELECTOR, status, sizeof(*status),
> 
> 0, OTG_STATUS_SELECTOR, &status, sizeof(status);
> ??

You mustn't do DMA to addresses on the stack.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux