Skip to content

Commit 1081c16

Browse files
committed
PM: hibernate: Drop NULL pointer checks before acomp_request_free()
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
1 parent 2a71519 commit 1081c16

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

kernel/power/swap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,8 @@ static int save_compressed_image(struct swap_map_handle *handle,
902902
for (thr = 0; thr < nr_threads; thr++) {
903903
if (data[thr].thr)
904904
kthread_stop(data[thr].thr);
905-
if (data[thr].cr)
906-
acomp_request_free(data[thr].cr);
905+
906+
acomp_request_free(data[thr].cr);
907907

908908
if (!IS_ERR_OR_NULL(data[thr].cc))
909909
crypto_free_acomp(data[thr].cc);
@@ -1502,8 +1502,8 @@ static int load_compressed_image(struct swap_map_handle *handle,
15021502
for (thr = 0; thr < nr_threads; thr++) {
15031503
if (data[thr].thr)
15041504
kthread_stop(data[thr].thr);
1505-
if (data[thr].cr)
1506-
acomp_request_free(data[thr].cr);
1505+
1506+
acomp_request_free(data[thr].cr);
15071507

15081508
if (!IS_ERR_OR_NULL(data[thr].cc))
15091509
crypto_free_acomp(data[thr].cc);

0 commit comments

Comments
 (0)