diff mbox series

usb: core: hcd: fix bug: application of sizeof to pointer

Message ID 20211207135401.5507-1-guozhengkui@vivo.com
State New
Headers show
Series usb: core: hcd: fix bug: application of sizeof to pointer | expand

Commit Message

Guo Zhengkui Dec. 7, 2021, 1:53 p.m. UTC
Fix following error:
./drivers/usb/core/hcd.c:1284:38-44: ERROR:
application of sizeof to pointer.

Use sizeof(*vaddr) instead.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
 drivers/usb/core/hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 4d326ee12c36..996d5273cf60 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(*vaddr),
 				 mem_flags, dma_handle);
 	if (!vaddr)
 		return -ENOMEM;