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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <818b7848-1b34-49dc-87bd-0438a82f2ebf@kernel.org>
Date: Thu, 4 Sep 2025 12:55:23 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Zihuan Zhang <zhangzihuan@...inos.cn>,
 "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>,
 Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
 Michael Ellerman <mpe@...erman.id.au>, Alim Akhtar
 <alim.akhtar@...sung.com>, Thierry Reding <thierry.reding@...il.com>,
 MyungJoo Ham <myungjoo.ham@...sung.com>,
 Kyungmin Park <kyungmin.park@...sung.com>,
 Chanwoo Choi <cw00.choi@...sung.com>,
 Jani Nikula <jani.nikula@...ux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@...el.com>, Tvrtko Ursulin
 <tursulin@...ulin.net>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>, Daniel Lezcano <daniel.lezcano@...nel.org>,
 Sascha Hauer <s.hauer@...gutronix.de>, Shawn Guo <shawnguo@...nel.org>,
 Eduardo Valentin <edubezval@...il.com>, Keerthy <j-keerthy@...com>,
 Ben Horgan <ben.horgan@....com>, zhenglifeng <zhenglifeng1@...wei.com>,
 Zhang Rui <rui.zhang@...el.com>, Len Brown <lenb@...nel.org>,
 Lukasz Luba <lukasz.luba@....com>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Beata Michalska <beata.michalska@....com>, Fabio Estevam
 <festevam@...il.com>, Pavel Machek <pavel@...nel.org>,
 Sumit Gupta <sumitg@...dia.com>,
 Prasanna Kumar T S M <ptsm@...ux.microsoft.com>,
 Sudeep Holla <sudeep.holla@....com>, Yicong Yang <yangyicong@...ilicon.com>,
 linux-pm@...r.kernel.org, linux-acpi@...r.kernel.org,
 linuxppc-dev@...ts.ozlabs.org, linux-arm-kernel@...ts.infradead.org,
 intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
 imx@...ts.linux.dev, linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 07/10] powercap: dtpm_cpu: Use scope-based cleanup
 helper

On 04/09/2025 12:37, Zihuan Zhang wrote:
>>   * Lastly, given that the benefit of cleanup helpers is removal of
>>   * "goto", and that the "goto" statement can jump between scopes, the
>>   * expectation is that usage of "goto" and cleanup helpers is never
>>   * mixed in the same function. I.e. for a given routine, convert all
>>   * resources that need a "goto" cleanup to scope-based cleanup, or
>>   * convert none of them.
> 
> 
> Should I replace all the memory allocation cleanups here with `__free`?
> That would allow us to drop all the `goto`s, but since this function has
> quite a few of them, I’m concerned it might introduce new issues. What’s
> your recommendation?

If you keep asking this, I have doubts you really know how to use
cleanup.h. Don't blindly convert code to cleanup.h. It's very odd syntax
and it is not even welcomed everywhere.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ