Skip to content

Commit 82cd3ba

Browse files
Bernard Zhaotiwai
authored andcommitted
ALSA: oss: remove useless NULL check before kfree
Tis patch try to remove useless NULL check before kfree Signed-off-by: Bernard Zhao <bernard@vivo.com> Link: https://lore.kernel.org/r/20211206014135.320720-1-bernard@vivo.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent d13a8f6 commit 82cd3ba

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

sound/core/info_oss.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ int snd_oss_info_register(int dev, int num, char *string)
3232
mutex_lock(&strings);
3333
if (string == NULL) {
3434
x = snd_sndstat_strings[num][dev];
35-
if (x) {
36-
kfree(x);
37-
x = NULL;
38-
}
35+
kfree(x);
36+
x = NULL;
3937
} else {
4038
x = kstrdup(string, GFP_KERNEL);
4139
if (x == NULL) {

0 commit comments

Comments
 (0)