* [PATCH v1] PM: hibernate: Drop NULL pointer checks before acomp_request_free()
@ 2026-01-26 20:03 Rafael J. Wysocki
2026-01-27 17:34 ` Malaya Kumar Rout
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-01-26 20:03 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Malaya Kumar Rout
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Since acomp_request_free() checks its argument against NULL, the NULL
pointer checks before calling it added by commit ("7966cf0ebe32 PM:
hibernate: Fix crash when freeing invalid crypto compressor") are
redundant, so drop them.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
kernel/power/swap.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -902,8 +902,8 @@ out_clean:
for (thr = 0; thr < nr_threads; thr++) {
if (data[thr].thr)
kthread_stop(data[thr].thr);
- if (data[thr].cr)
- acomp_request_free(data[thr].cr);
+
+ acomp_request_free(data[thr].cr);
if (!IS_ERR_OR_NULL(data[thr].cc))
crypto_free_acomp(data[thr].cc);
@@ -1502,8 +1502,8 @@ out_clean:
for (thr = 0; thr < nr_threads; thr++) {
if (data[thr].thr)
kthread_stop(data[thr].thr);
- if (data[thr].cr)
- acomp_request_free(data[thr].cr);
+
+ acomp_request_free(data[thr].cr);
if (!IS_ERR_OR_NULL(data[thr].cc))
crypto_free_acomp(data[thr].cc);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] PM: hibernate: Drop NULL pointer checks before acomp_request_free()
2026-01-26 20:03 [PATCH v1] PM: hibernate: Drop NULL pointer checks before acomp_request_free() Rafael J. Wysocki
@ 2026-01-27 17:34 ` Malaya Kumar Rout
0 siblings, 0 replies; 2+ messages in thread
From: Malaya Kumar Rout @ 2026-01-27 17:34 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux PM, LKML
On Tue, Jan 27, 2026 at 1:34 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Since acomp_request_free() checks its argument against NULL, the NULL
> pointer checks before calling it added by commit ("7966cf0ebe32 PM:
> hibernate: Fix crash when freeing invalid crypto compressor") are
> redundant, so drop them.
>
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> kernel/power/swap.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> --- a/kernel/power/swap.c
> +++ b/kernel/power/swap.c
> @@ -902,8 +902,8 @@ out_clean:
> for (thr = 0; thr < nr_threads; thr++) {
> if (data[thr].thr)
> kthread_stop(data[thr].thr);
> - if (data[thr].cr)
> - acomp_request_free(data[thr].cr);
> +
> + acomp_request_free(data[thr].cr);
>
> if (!IS_ERR_OR_NULL(data[thr].cc))
> crypto_free_acomp(data[thr].cc);
> @@ -1502,8 +1502,8 @@ out_clean:
> for (thr = 0; thr < nr_threads; thr++) {
> if (data[thr].thr)
> kthread_stop(data[thr].thr);
> - if (data[thr].cr)
> - acomp_request_free(data[thr].cr);
> +
> + acomp_request_free(data[thr].cr);
>
> if (!IS_ERR_OR_NULL(data[thr].cc))
> crypto_free_acomp(data[thr].cc);
>
>
>
Thanks, this makes sense to me. Dropping the redundant NULL checks
looks correct.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-27 17:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 20:03 [PATCH v1] PM: hibernate: Drop NULL pointer checks before acomp_request_free() Rafael J. Wysocki
2026-01-27 17:34 ` Malaya Kumar Rout
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox