From a927ae1fba4b0aa51e1fa9b43c4018bbf10d27f6 Mon Sep 17 00:00:00 2001 From: Guo Zhengkui Date: Thu, 9 Dec 2021 14:23:05 +0800 Subject: [PATCH] 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 Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20211209062441.9856-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 4d326ee..9ffc63a 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -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; -- 2.7.4