[CRIU] [PATCH 05/16] mem/vma: Use memset for vm_area_list_init
Mike Rapoport
rppt at linux.ibm.com
Mon Jul 8 15:37:31 MSK 2019
On Fri, Jul 05, 2019 at 06:38:00PM +0300, Cyrill Gorcunov wrote:
> To eliminate side effects, in particular setting nr_aios
> is already missing here.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
Reviewed-by: Mike Rapoport <rppt at linux.ibm.com>
> ---
> criu/include/vma.h | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/criu/include/vma.h b/criu/include/vma.h
> index c297c0d141a0..6f5ee19d3888 100644
> --- a/criu/include/vma.h
> +++ b/criu/include/vma.h
> @@ -7,6 +7,7 @@
> #include "images/vma.pb-c.h"
>
> #include <sys/mman.h>
> +#include <string.h>
>
> struct vm_area_list {
> struct list_head h;
> @@ -21,11 +22,8 @@ struct vm_area_list {
>
> static inline void vm_area_list_init(struct vm_area_list *vml)
> {
> + memset(vml, 0, sizeof(*vml));
> INIT_LIST_HEAD(&vml->h);
> - vml->nr = 0;
> - vml->priv_size = 0;
> - vml->priv_longest = 0;
> - vml->shared_longest = 0;
> }
>
> struct file_desc;
> --
> 2.20.1
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
--
Sincerely yours,
Mike.
More information about the CRIU
mailing list