Re: [Cocci] [PATCH v2] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-29 Thread Johan Hovold
On Tue, Apr 27, 2021 at 03:44:25PM +0200, Julia Lawall wrote: > On Tue, 27 Apr 2021, Johan Hovold wrote: > > > On Mon, Apr 26, 2021 at 08:54:04PM +0200, Julia Lawall wrote: > > > pm_runtime_get_sync keeps a reference count on failure, which can lead > > > to leaks. pm_runtime_resume_and_get

Re: [Cocci] [PATCH v2] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-27 Thread Rafael J. Wysocki
On Tue, Apr 27, 2021 at 3:18 PM Johan Hovold wrote: > > On Mon, Apr 26, 2021 at 08:54:04PM +0200, Julia Lawall wrote: > > pm_runtime_get_sync keeps a reference count on failure, which can lead > > to leaks. pm_runtime_resume_and_get drops the reference count in the > > failure case. This rule

Re: [Cocci] [PATCH v2] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-27 Thread Johan Hovold
On Mon, Apr 26, 2021 at 08:54:04PM +0200, Julia Lawall wrote: > pm_runtime_get_sync keeps a reference count on failure, which can lead > to leaks. pm_runtime_resume_and_get drops the reference count in the > failure case. This rule very conservatively follows the definition of >

Re: [Cocci] [PATCH v2] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-27 Thread Julia Lawall
On Tue, 27 Apr 2021, Johan Hovold wrote: > On Mon, Apr 26, 2021 at 08:54:04PM +0200, Julia Lawall wrote: > > pm_runtime_get_sync keeps a reference count on failure, which can lead > > to leaks. pm_runtime_resume_and_get drops the reference count in the > > failure case. This rule very

[Cocci] [PATCH v2] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-26 Thread Julia Lawall
pm_runtime_get_sync keeps a reference count on failure, which can lead to leaks. pm_runtime_resume_and_get drops the reference count in the failure case. This rule very conservatively follows the definition of pm_runtime_resume_and_get to address the cases where the reference count is unlikely