lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Nov 2017 22:10:16 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     alsa-devel@...a-project.org, Jaroslav Kysela <perex@...ex.cz>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Peter Ujfalusi <peter.ujfalusi@...com>,
        Takashi Iwai <tiwai@...e.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 2/4] ASoC: twl4030: Use common error handling code in
 twl4030_get_pdata()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 23 Nov 2017 21:35:28 +0100

Add a jump target so that a bit of exception handling can be better reused
in an if branch of this function.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 sound/soc/codecs/twl4030.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 90691701b082..a1f0b45c83ca 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -239,11 +239,11 @@ static struct twl4030_codec_data *twl4030_get_pdata(struct snd_soc_codec *codec)
 		pdata = devm_kzalloc(codec->dev,
 				     sizeof(struct twl4030_codec_data),
 				     GFP_KERNEL);
-		if (!pdata) {
-			of_node_put(twl4030_codec_node);
-			return NULL;
-		}
+		if (!pdata)
+			goto put_node;
+
 		twl4030_setup_pdata_of(pdata, twl4030_codec_node);
+put_node:
 		of_node_put(twl4030_codec_node);
 	}
 
-- 
2.15.0

Powered by blists - more mailing lists