usb: usbfs: only account once for mmap()'ed usb memory usage
Memory usage for USB memory allocated via mmap() is already accounted for at mmap() time; no need to account for it again at submiturb time. Signed-off-by: Gavin Li <git@thegavinli.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/20190814212924.10381-1-gavinli@thegavinli.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
a599e48662
Коммит
b08a6259a1
|
@ -1664,7 +1664,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
|
|||
if (as->usbm)
|
||||
num_sgs = 0;
|
||||
|
||||
u += sizeof(struct async) + sizeof(struct urb) + uurb->buffer_length +
|
||||
u += sizeof(struct async) + sizeof(struct urb) +
|
||||
(as->usbm ? 0 : uurb->buffer_length) +
|
||||
num_sgs * sizeof(struct scatterlist);
|
||||
ret = usbfs_increase_memory_usage(u);
|
||||
if (ret)
|
||||
|
|
Загрузка…
Ссылка в новой задаче