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>
This commit is contained in:
Bernard Zhao 2021-12-05 17:40:46 -08:00 committed by Takashi Iwai
parent d13a8f6d8e
commit 82cd3ba691
1 changed files with 2 additions and 4 deletions

View File

@ -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) {