Commit 82cd3ba6 authored by Bernard Zhao's avatar Bernard Zhao Committed by Takashi Iwai

ALSA: oss: remove useless NULL check before kfree

Tis patch try to remove useless NULL check before kfree
Signed-off-by: default avatarBernard Zhao <bernard@vivo.com>
Link: https://lore.kernel.org/r/20211206014135.320720-1-bernard@vivo.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d13a8f6d
...@@ -32,10 +32,8 @@ int snd_oss_info_register(int dev, int num, char *string) ...@@ -32,10 +32,8 @@ int snd_oss_info_register(int dev, int num, char *string)
mutex_lock(&strings); mutex_lock(&strings);
if (string == NULL) { if (string == NULL) {
x = snd_sndstat_strings[num][dev]; x = snd_sndstat_strings[num][dev];
if (x) { kfree(x);
kfree(x); x = NULL;
x = NULL;
}
} else { } else {
x = kstrdup(string, GFP_KERNEL); x = kstrdup(string, GFP_KERNEL);
if (x == NULL) { if (x == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment