]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PM: hibernate: Drop NULL pointer checks before acomp_request_free()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 26 Jan 2026 20:03:57 +0000 (21:03 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 28 Jan 2026 21:12:55 +0000 (22:12 +0100)
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>
Link: https://patch.msgid.link/6233709.lOV4Wx5bFT@rafael.j.wysocki
kernel/power/swap.c

index 8050e5182835166a047f4a46078c448f9787083c..7e462957c9bf6a54168903575f107f9e75f5c550 100644 (file)
@@ -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);