Vaishali Thakkar writes:
> When sizeof is applied to a pointer typed expression, it gives
> the size of the pointer. So, do not use sizeof on pointer type.
What if the intended result was the size of the pointer?
> Problem found using Coccinelle.
Yes, sure. But
Vaishali Thakkar wrote:
> When sizeof is applied to a pointer typed expression, it gives
> the size of the pointer.
And why would that be wrong in this case?
> +++ b/drivers/usb/core/hcd.c
> @@ -1386,7 +1386,7 @@ static int hcd_alloc_coherent(struct usb_bus *bus,
> return -EFAULT;
When sizeof is applied to a pointer typed expression, it gives
the size of the pointer. So, do not use sizeof on pointer type.
Problem found using Coccinelle.
Signed-off-by: Vaishali Thakkar
---
drivers/usb/core/hcd.c | 2 +-
1 file changed, 1 insertion(+), 1