>>> On 25.04.16 at 17:35, <konrad.w...@oracle.com> wrote: > From: Ross Lagerwall <ross.lagerw...@citrix.com> > > Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> > Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> > > --- > Cc: Ian Jackson <ian.jack...@eu.citrix.com> > Cc: Jan Beulich <jbeul...@suse.com> > Cc: Keir Fraser <k...@xen.org> > Cc: Tim Deegan <t...@xen.org> > > v6: Drop recursive lock - also now the caller is holding the lock > Move the code up in the code above. > v7: Add Andrew's Reviewed-by > v9: Add const on struct payload. > Check data->id.len != payload->id.len in the loop > --- > --- > xen/common/xsplice.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/xen/common/xsplice.c b/xen/common/xsplice.c > index a8b208d..b5e2135 100644 > --- a/xen/common/xsplice.c > +++ b/xen/common/xsplice.c > @@ -520,6 +520,8 @@ static int prepare_payload(struct payload *payload, > sec = xsplice_elf_sec_by_name(elf, ELF_BUILD_ID_NOTE); > if ( sec ) > { > + const struct payload *data; > + > n = sec->load_addr; > > if ( sec->sec->sh_size <= sizeof(*n) ) > @@ -531,6 +533,20 @@ static int prepare_payload(struct payload *payload, > > if ( !payload->id.len || !payload->id.p ) > return -EINVAL; > + > + /* Make sure it is not a duplicate. */ > + list_for_each_entry ( data, &payload_list, list ) > + { > + /* No way _this_ payload is on the list. */ > + ASSERT(data != payload); > + if ( data->id.len != payload->id.len ||
DYM if ( data->id.len == payload->id.len && ? (I'm sorry for having suggested it the wrong way round in the reply to v8.1.) With that fixed Reviewed-by: Jan Beulich <jbeul...@suse.com> Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel