diff mbox

USB: serial: cp210x: fix noderef.cocci warnings

Message ID 20160113175716.GA8557@lkp-nex05
State New
Headers show

Commit Message

kernel test robot Jan. 13, 2016, 5:57 p.m. UTC
drivers/usb/serial/cp210x.c:1132:15-21: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

CC: Martyn Welch <martyn.welch@collabora.co.uk>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 cp210x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -1129,7 +1129,7 @@  static int cp210x_shared_gpio_init(struc
 	if ((tmp & CP210X_FEATURE_HAS_SHARED_GPIO) == 0)
 		return 0;
 
-	buf = kzalloc(sizeof(buf), GFP_KERNEL);
+	buf = kzalloc(sizeof(*buf), GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;