[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170903141122.GA2848@udknight>
Date: Sun, 3 Sep 2017 22:11:22 +0800
From: Wang YanQing <udknight@...il.com>
To: tiwai@...e.de
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ALSA: hda: Fix forget to free resource in error handling
code path in hda_codec_driver_probe
When hda_codec_driver_probe meet error and return failure, we need
to free resource with patch_ops.free, or we will get resource leak.
Signed-off-by: Wang YanQing <udknight@...il.com>
---
sound/pci/hda/hda_bind.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
index 6efadbf..f1b1b7e 100644
--- a/sound/pci/hda/hda_bind.c
+++ b/sound/pci/hda/hda_bind.c
@@ -123,6 +123,8 @@ static int hda_codec_driver_probe(struct device *dev)
module_put(owner);
error:
+ if (codec->patch_ops.free)
+ codec->patch_ops.free(codec);
snd_hda_codec_cleanup_for_unbind(codec);
return err;
}
--
1.8.5.6.2.g3d8a54e.dirty
Powered by blists - more mailing lists