All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sound: Remove redundant steps
@ 2021-03-10  6:34 zuoqilin1
  2021-03-10  9:09 ` Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: zuoqilin1 @ 2021-03-10  6:34 UTC (permalink / raw)
  To: tiwai, lars, joe, broonie, perex; +Cc: zuoqilin, alsa-devel

From: zuoqilin <zuoqilin@yulong.com>

If kzalloc fail,not need free it,so just return
-ENOMEM when kzalloc fail.

Signed-off-by: zuoqilin <zuoqilin@yulong.com>
---
 sound/core/oss/mixer_oss.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index bec9283..eec61dc 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -800,8 +800,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
 	uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
 	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
 	if (uinfo == NULL || uctl == NULL) {
-		err = -ENOMEM;
-		goto __free_only;
+		return -ENOMEM;
 	}
 	down_read(&card->controls_rwsem);
 	kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
@@ -851,8 +850,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
 	uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
 	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
 	if (uinfo == NULL || uctl == NULL) {
-		err = -ENOMEM;
-		goto __free_only;
+		return -ENOMEM;
 	}
 	down_read(&card->controls_rwsem);
 	kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-10 18:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10  6:34 [PATCH] sound: Remove redundant steps zuoqilin1
2021-03-10  9:09 ` Takashi Iwai
2021-03-10 13:19 ` kernel test robot
2021-03-10 13:19   ` kernel test robot
2021-03-10 18:33 ` [kbuild] " Dan Carpenter
2021-03-10 18:33   ` Dan Carpenter
2021-03-10 18:33   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.