usb: core: hcd: change sizeof(vaddr) to sizeof(unsigned long)
`vaddr` is a pointer to unsigned char. sizeof(vaddr) here intends to get the size of a pointer. But readers may get confused. Change sizeof(vaddr) to sizeof(unsigned long) makes more sense. Suggested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> Link: https://lore.kernel.org/r/20211209062441.9856-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
aa9c2219f9
commit
a927ae1fba
|
@ -1281,7 +1281,7 @@ static int hcd_alloc_coherent(struct usb_bus *bus,
|
|||
return -EFAULT;
|
||||
}
|
||||
|
||||
vaddr = hcd_buffer_alloc(bus, size + sizeof(vaddr),
|
||||
vaddr = hcd_buffer_alloc(bus, size + sizeof(unsigned long),
|
||||
mem_flags, dma_handle);
|
||||
if (!vaddr)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in New Issue