]> git.baikalelectronics.ru Git - kernel.git/commit
PM / Hibernate: Fix error handling in save_image()
authorJiri Slaby <jirislaby@gmail.com>
Wed, 28 Oct 2009 21:55:33 +0000 (22:55 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 3 Nov 2009 10:02:43 +0000 (11:02 +0100)
commit6ce4a6f52eb672dd20bf54b3c9fb3022a09adce3
tree59c00800cead3926938a68145dcddba4b9ad160f
parent9b95cef2c23c9516a34a108e87e1d57381151e63
PM / Hibernate: Fix error handling in save_image()

There are too many retval variables in save_image(). Thus error return
value from snapshot_read_next() may be ignored and only part of the
snapshot (successfully) written.

Remove 'error' variable, invert the condition in the do-while loop
and convert the loop to use only 'ret' variable.

Switch the rest of the function to consider only 'ret'.

Also make sure we end printed line by \n if an error occurs.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
kernel/power/swap.c