From: Li zeming Date: Tue, 24 Oct 2023 02:04:34 +0000 (+0800) Subject: PM: hibernate: Do not initialize error in snapshot_write_next() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4ac934b1aaa99e00ca25875d55094a4fe34e212d;p=linux.git PM: hibernate: Do not initialize error in snapshot_write_next() The error variable in snapshot_write_next() gets a value before it is used, so don't initialize it to 0 upfront. Signed-off-by: Li zeming [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 71b2f12ed3b59..e3e8f1c6e75f6 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -2778,7 +2778,7 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca) int snapshot_write_next(struct snapshot_handle *handle) { static struct chain_allocator ca; - int error = 0; + int error; next: /* Check if we have already loaded the entire image */