lkml.org 
[lkml]   [2019]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 1/3] PM / wakeup: Drop wakeup_source_init(), wakeup_source_prepare()
From
Date
Quoting Tri Vo (2019-08-05 14:11:55)
> On Mon, Aug 5, 2019 at 1:54 PM Stephen Boyd <swboyd@chromium.org> wrote:
> >
> > Quoting Tri Vo (2019-08-05 10:58:46)
> > > @@ -96,13 +79,23 @@ EXPORT_SYMBOL_GPL(wakeup_source_prepare);
> > > struct wakeup_source *wakeup_source_create(const char *name)
> > > {
> > > struct wakeup_source *ws;
> > > + const char *ws_name;
> > >
> > > - ws = kmalloc(sizeof(*ws), GFP_KERNEL);
> > > + ws = kzalloc(sizeof(*ws), GFP_KERNEL);
> > > if (!ws)
> > > - return NULL;
> > > + goto err_ws;
> > > +
> > > + ws_name = kstrdup_const(name, GFP_KERNEL);
> > > + if (!ws_name)
> >
> > Does this intentionally change this function to return an error if
> > 'name' is NULL? Before, wakeup_source_prepare() would just assign
> > ws->name to NULL, but now it errors out. I don't see how it's good or
> > useful to allow NULL for the wakeup source name, but it is what it is.
>
> Yes, the change to not allow ws->name to be NULL is intentional.

Ok. It would be good to mention it in the commit text so we don't think
it was a bug when looking back a few months later.

\
 
 \ /
  Last update: 2019-08-05 23:15    [W:0.090 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site