Skip to contentSkip to conversation

sound/core: remove useless NULL check before kfree

PATCH Applied Bernard Zhao 2 participants 2 messages Dec 6, 2021 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/core: remove useless NULL check before kfree

Tis patch try to remove useless NULL check before kfree

---
 sound/core/info_oss.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
sound/core/info_oss.c +2 -4
index 1ba887c7954e..ebc714b2f46b 100644
@@ -32,10 +32,8 @@ int snd_oss_info_register(int dev, int num, char *string)
 	mutex_lock(&strings);
 	if (string == NULL) {
 		x = snd_sndstat_strings[num][dev];
-		if (x) {
-			kfree(x);
-			x = NULL;
-		}
+		kfree(x);
+		x = NULL;
 	} else {
 		x = kstrdup(string, GFP_KERNEL);
 		if (x == NULL) {
Signature · 1 line
2.33.1