kexec: clear crashk_res if all its memory has been released
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 27 May 2023 12:34:36 +0000 (20:34 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 10 Jun 2023 00:44:23 +0000 (17:44 -0700)
commitf7f567b95b12eda7a6a273b8cb82d152491bc0da
tree3b4e73ef30990adbf6d8f347f223ab2fa392be95
parent6f22a744f4ee7a22be4704cf93bbe22decc7e79e
kexec: clear crashk_res if all its memory has been released

If the resource of crashk_res has been released, it is better to clear
crashk_res.start and crashk_res.end.  Because 'end = start - 1' is not
reasonable, and in some places the test is based on crashk_res.end, not
resource_size(&crashk_res).

Link: https://lkml.kernel.org/r/20230527123439.772-4-thunder.leizhen@huawei.com
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Cong Wang <amwang@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kexec_core.c