Merge tag 'pm-6.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
"This fixes a crash in the hibernation image saving code that can be
triggered when the given compression algorithm is unavailable (Malaya
Kumar Rout)"

* tag 'pm-6.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM: hibernate: Fix crash when freeing invalid crypto compressor

Changed files
+10 -4
kernel
power
+10 -4
kernel/power/swap.c
··· 902 902 for (thr = 0; thr < nr_threads; thr++) { 903 903 if (data[thr].thr) 904 904 kthread_stop(data[thr].thr); 905 - acomp_request_free(data[thr].cr); 906 - crypto_free_acomp(data[thr].cc); 905 + if (data[thr].cr) 906 + acomp_request_free(data[thr].cr); 907 + 908 + if (!IS_ERR_OR_NULL(data[thr].cc)) 909 + crypto_free_acomp(data[thr].cc); 907 910 } 908 911 vfree(data); 909 912 } ··· 1502 1499 for (thr = 0; thr < nr_threads; thr++) { 1503 1500 if (data[thr].thr) 1504 1501 kthread_stop(data[thr].thr); 1505 - acomp_request_free(data[thr].cr); 1506 - crypto_free_acomp(data[thr].cc); 1502 + if (data[thr].cr) 1503 + acomp_request_free(data[thr].cr); 1504 + 1505 + if (!IS_ERR_OR_NULL(data[thr].cc)) 1506 + crypto_free_acomp(data[thr].cc); 1507 1507 } 1508 1508 vfree(data); 1509 1509 }