PM: hibernate: Do not initialize error in snapshot_write_next()
authorLi zeming <zeming@nfschina.com>
Tue, 24 Oct 2023 02:04:34 +0000 (10:04 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 11 Dec 2023 21:09:52 +0000 (22:09 +0100)
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 <zeming@nfschina.com>
[ rjw: Subject and changelog rewrite ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/snapshot.c

index 71b2f12ed3b5926dadf7a55ee421e39049d0501f..e3e8f1c6e75f6f4963bdf886773aa0c3d6b6958c 100644 (file)
@@ -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 */