Skip to content

Commit 3baa40d

Browse files
JuliaLawalltiwai
authored andcommitted
ALSA: seq: oss: use kzalloc
Use kzalloc instead of kmalloc + memset. The semantic patch that makes this change is: (https://coccinelle.gitlabpages.inria.fr/website/) //<smpl> @@ expression res, size, flag; @@ - res = kmalloc(size, flag); + res = kzalloc(size, flag); ... - memset(res, 0, size); //</smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Link: https://lore.kernel.org/r/20220312102705.71413-4-Julia.Lawall@inria.fr Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 327e8ba commit 3baa40d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sound/core/seq/oss/seq_oss_init.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ snd_seq_oss_create_client(void)
6666
struct snd_seq_port_info *port;
6767
struct snd_seq_port_callback port_callback;
6868

69-
port = kmalloc(sizeof(*port), GFP_KERNEL);
69+
port = kzalloc(sizeof(*port), GFP_KERNEL);
7070
if (!port) {
7171
rc = -ENOMEM;
7272
goto __error;
@@ -81,7 +81,6 @@ snd_seq_oss_create_client(void)
8181
system_client = rc;
8282

8383
/* create annoucement receiver port */
84-
memset(port, 0, sizeof(*port));
8584
strcpy(port->name, "Receiver");
8685
port->addr.client = system_client;
8786
port->capability = SNDRV_SEQ_PORT_CAP_WRITE; /* receive only */

0 commit comments

Comments
 (0)