Re: [PATCH] swswsup: return correct load_image error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 24 March 2006 06:00, Con Kolivas wrote:
> On Tuesday 21 March 2006 10:22, Rafael J. Wysocki wrote:
> > Basically, yes.  swsusp.c and snapshot.c contain common functions,
> > disk.c and swap.c contain the code used by the built-in swsusp only,
> > and user.c contains the userland interface.  If you want something to
> > be run by the built-in swsusp only, place it in disk.c.
> 
> Ok. A quick look at the code in swap.c makes me wonder if we need this patch.
> 
> Rafael?

Yes, we do.  Thanks.

Andrew, could you please pick it up?

Rafael


> ---
> If there's an error in load_image() we should return that without checking
> snapshot_image_loaded.
> 
> Signed-off-by: Con Kolivas <[email protected]>
> 
> ---
>  kernel/power/swap.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.16-mm1/kernel/power/swap.c
> ===================================================================
> --- linux-2.6.16-mm1.orig/kernel/power/swap.c	2006-03-24 15:04:13.000000000 +1100
> +++ linux-2.6.16-mm1/kernel/power/swap.c	2006-03-24 15:55:30.000000000 +1100
> @@ -454,10 +454,11 @@ static int load_image(struct swap_map_ha
>  			nr_pages++;
>  		}
>  	} while (ret > 0);
> -	if (!error)
> +	if (!error) {
>  		printk("\b\b\b\bdone\n");
> -	if (!snapshot_image_loaded(snapshot))
> -		error = -ENODATA;
> +		if (!snapshot_image_loaded(snapshot))
> +			error = -ENODATA;
> +	}
>  	return error;
>  }
>  
> 
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux