[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2024041941-declared-footrest-9e8f@gregkh>
Date: Fri, 19 Apr 2024 15:59:46 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Wander Lairson Costa <wander@...hat.com>
Cc: David Gow <davidgow@...gle.com>,
Brendan Higgins <brendan.higgins@...ux.dev>,
Rae Moar <rmoar@...gle.com>, Shuah Khan <skhan@...uxfoundation.org>,
Maxime Ripard <mripard@...nel.org>,
Matti Vaittinen <mazziesaccount@...il.com>,
"open list:KERNEL UNIT TESTING FRAMEWORK (KUnit)" <linux-kselftest@...r.kernel.org>,
"open list:KERNEL UNIT TESTING FRAMEWORK (KUnit)" <kunit-dev@...glegroups.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] kunit: avoid memory leak on device register error
On Fri, Apr 19, 2024 at 09:30:06AM -0300, Wander Lairson Costa wrote:
> As a side note, the behavior of device_register() seems
> counterintuitive and error-prone, IMO. If the function returns an
> error, it should ensure it leaks no resource and shouldn't require the
> caller to do any cleanup.
I too want a pony, but that's not the way the code works here, sorry.
It's always been like this, and has always been a problem, but last time
I looked, there was no way to really fix this. That's why we document
it a lot to make sure people don't get the error paths wrong here. I
know it's a pain :(
sorry,
greg k-h
Powered by blists - more mailing lists