* [PATCH] sound/core: remove useless NULL check before kfree
@ 2021-12-06 1:40 Bernard Zhao
2021-12-06 9:08 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Bernard Zhao @ 2021-12-06 1:40 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Bernard Zhao, alsa-devel, linux-kernel
Tis patch try to remove useless NULL check before kfree
Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
sound/core/info_oss.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c
index 1ba887c7954e..ebc714b2f46b 100644
--- a/sound/core/info_oss.c
+++ b/sound/core/info_oss.c
@@ -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) {
--
2.33.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sound/core: remove useless NULL check before kfree
2021-12-06 1:40 [PATCH] sound/core: remove useless NULL check before kfree Bernard Zhao
@ 2021-12-06 9:08 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2021-12-06 9:08 UTC (permalink / raw)
To: Bernard Zhao; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel
On Mon, 06 Dec 2021 02:40:46 +0100,
Bernard Zhao wrote:
>
> Tis patch try to remove useless NULL check before kfree
>
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
Thanks, applied now (with the correction of the subject prefix).
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-06 9:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 1:40 [PATCH] sound/core: remove useless NULL check before kfree Bernard Zhao
2021-12-06 9:08 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®