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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 20 Jul 2020 16:19:06 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     Jing Xiangfeng <jingxiangfeng@...wei.com>,
        linux-clk@...r.kernel.org, linux-omap@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Michael Turquette <mturquette@...libre.com>,
        Rob Herring <robh@...nel.org>, Stephen Boyd <sboyd@...nel.org>,
        Tero Kristo <t-kristo@...com>, Tony Lindgren <tony@...mide.com>
Subject: Re: [PATCH] clk: ti: clkctrl: add the missed kfree() for
 _ti_omap4_clkctrl_setup()

…
> +++ b/drivers/clk/ti/clkctrl.c
> @@ -655,8 +655,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
>  		}
>
>  		hw = kzalloc(sizeof(*hw), GFP_KERNEL);
> -		if (!hw)
> +		if (!hw) {
> +			kfree(clkctrl_name);
>  			return;
> +		}
…

I suggest to use an additional label instead.

 		if (!hw)
-			return;
+			goto free_control_name;


By the way:
How do you think about to replace the label “cleanup” by other jump targets
for better exception handling in this function implementation?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ