sound: oss: use kzalloc rather than kmalloc with memset
PATCH v2 26/27 sound: oss: use kzalloc rather than kmalloc with memset
Use zeroing allocator instead of using allocator followed with memset with 0.
Signed-off-by Fuqian Huang <[email protected]>
--- sound/core/seq/oss/seq_oss_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/core/seq/oss/seq_oss_init.c +1 -2
@@ -66,7 +66,7 @@ snd_seq_oss_create_client(void)struct snd_seq_port_info *port;struct snd_seq_port_callback port_callback; - port =kmalloc (sizeof (*port),GFP_KERNEL ); + port =kzalloc (sizeof (*port),GFP_KERNEL );if (!port) { rc = -ENOMEM ; goto __error;
@@ -81,7 +81,6 @@ snd_seq_oss_create_client(void) system_client = rc;/* create annoucement receiver port */ -memset (port,0 ,sizeof (*port));strcpy (port->name,"Receiver" ); port->addr.client = system_client; port->capability =SNDRV_SEQ_PORT_CAP_WRITE ;/* receive only */
Signature · 1 line
2.11.0