[PATCH][weston] ivi-shell: initialize all fields in create_layout_transition
Bryce Harrington
bryce at osg.samsung.com
Tue Sep 22 18:20:58 PDT 2015
On Tue, Sep 22, 2015 at 05:28:32PM -0700, Bryce Harrington wrote:
> On Sun, Sep 20, 2015 at 02:47:37AM +0200, John-John Tedro wrote:
> > create_layout_transition does not initialize is_transition_func.
> >
> > This patch initializes it to NULL.
> >
> > Signed-off-by: John-John Tedro <johnjohn.tedro at gmail.com>
>
> Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
>
> Btw, since this function sets nearly all the parameters to 0 or NULL, it
> might be better to change the malloc to a calloc, which will ensure all
> members are zero'd on allocation.
>
> That would avoid problems like this one, when new members get added to
> the struct. In addition, using calloc sometimes lets the kernel pick
> memory to give us that is already zero'd, which will be more efficient
> than zeroing things manually.
>
> Anyway, something you could consider as a follow up patch. Meanwhile
> I'll go ahead and land this one since it fixes a legit issue and is
> technically correct.
Thanks, pushed:
remote: I: patch #59952 updated using rev 9d7aff0e3813341236fa953850bd02ea75604e09
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/wayland/weston
bfae30d..9d7aff0 master -> master
This uncovered several tasks for follow up, too.
> > ---
> > ivi-shell/ivi-layout-transition.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
> > index d12a8f4..d45b332 100644
> > --- a/ivi-shell/ivi-layout-transition.c
> > +++ b/ivi-shell/ivi-layout-transition.c
> > @@ -251,6 +251,7 @@ create_layout_transition(void)
> >
> > transition->is_done = 0;
> >
> > + transition->is_transition_func = NULL;
> > transition->private_data = NULL;
> > transition->user_data = NULL;
> >
> > --
> > 2.1.4
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list