Skip to content

Commit 89bb957

Browse files
Wei Yongjungregkh
authored andcommitted
USB: cp210x: remove useless set memory to zero use memset()
The memory return by kzalloc() or kmem_cache_zalloc() has already be set to zero, so remove useless memset(0). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 027c521 commit 89bb957

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/usb/serial/cp210x.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,6 @@ static int cp210x_startup(struct usb_serial *serial)
865865
if (!port_priv)
866866
return -ENOMEM;
867867

868-
memset(port_priv, 0x00, sizeof(*port_priv));
869868
port_priv->bInterfaceNumber =
870869
serial->interface->cur_altsetting->desc.bInterfaceNumber;
871870

0 commit comments

Comments
 (0)