Re: [PATCH 1/1] cr: fix ckpt_obj_fetch return values

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

 



Quoting Serge E. Hallyn (serue@xxxxxxxxxx):
> ckpt_obj_fetch returned ERR_PTR(error) on some failures, NULL on
> others.  Not all of its callers were checking for NULL, which
> would lead to NULL dereferences.
> 
> Return -EINVAL if the object is not in the hash table.  Fix up
> pipe_file_restore to do the right thing.
> 
> Signed-off-by: Serge E. Hallyn <serue@xxxxxxxxxx>
> ---
>  checkpoint/files.c   |    4 +---
>  checkpoint/memory.c  |    6 +-----
>  checkpoint/objhash.c |    2 +-
>  checkpoint/process.c |    4 +---
>  fs/pipe.c            |    9 ++++-----
>  5 files changed, 8 insertions(+), 17 deletions(-)
> 
> diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
> index 0ed7cac..7b26005 100644
> --- a/checkpoint/objhash.c
> +++ b/checkpoint/objhash.c
> @@ -692,7 +692,7 @@ void *ckpt_obj_fetch(struct ckpt_ctx *ctx, int objref, enum obj_type type)
> 
>  	obj = obj_find_by_objref(ctx, objref);
>  	if (!obj)
> -		return NULL;
> +		ERR_PTR(-EINVAL);

obvious bug here :)

-serge
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux