Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1390864

Re: klp: make object/func-walking helpers more robust

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject Re: klp: make object/func-walking helpers more robust
Date 2016-04-29 10:40 +0200
Message-ID <rtc7U-2Py-13@gated-at.bofh.it> (permalink)
References <rsVgL-4Ob-33@gated-at.bofh.it> <rsYRk-83-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 28 Apr 2016, Jessica Yu wrote:

> > #define klp_for_each_object(patch, obj) \
> > -	for (obj = patch->objs; obj->funcs; obj++)
> > +	for (obj = patch->objs; obj->funcs || obj->name; obj++)
> 
> Remember that for patches to vmlinux, obj->name and obj->mod will also
> both be NULL. So if someone happens to forget to fill in obj->funcs
> for a vmlinux patch, we won't catch that case here. Perhaps we need a
> better way of determining whether we've reached the end of the array,
> or determining that the struct is truly empty..

I'd rather not over-compilcate it.

Admittedly, the change in the termination condition catches most of the 
errors made by the patch author, but not all.
But there are many other places in the kernel where inserting an empty 
item into the middle of statically initialized array will make the whole 
thing explode, so let's not try to be more clever than necessary.

I plan to queue Miroslav's patch unless there are serious objections 
raised.

Thanks,

-- 
Jiri Kosina
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] klp: make object/func-walking helpers more robust Miroslav Benes <mbenes@suse.cz> - 2016-04-28 16:40 +0200
  Re: klp: make object/func-walking helpers more robust Jessica Yu <jeyu@redhat.com> - 2016-04-28 20:30 +0200
    Re: klp: make object/func-walking helpers more robust Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-28 23:20 +0200
      Re: klp: make object/func-walking helpers more robust Miroslav Benes <mbenes@suse.cz> - 2016-04-29 09:50 +0200
        Re: klp: make object/func-walking helpers more robust Jessica Yu <jeyu@redhat.com> - 2016-04-29 18:20 +0200
    Re: klp: make object/func-walking helpers more robust Jiri Kosina <jikos@kernel.org> - 2016-04-29 10:40 +0200
  Re: klp: make object/func-walking helpers more robust Jessica Yu <jeyu@redhat.com> - 2016-04-29 18:30 +0200
  Re: [PATCH] klp: make object/func-walking helpers more robust Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-29 18:30 +0200
  Re: [PATCH] klp: make object/func-walking helpers more robust Jiri Kosina <jikos@kernel.org> - 2016-04-30 00:10 +0200

csiph-web