lkml.org 
[lkml]   [2011]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC][PATCH 2/6] x86, nmi: create new NMI handler routines
    From
    Date
    On Fri, 2011-08-19 at 16:37 -0400, Don Zickus wrote:
    > +int register_nmi_handler(unsigned int type, nmi_handler_t handler,
    > + unsigned long nmiflags, const char *devname)
    > +{
    > + struct nmiaction *action;
    > + int retval;
    > +
    > + if (!handler)
    > + return -EINVAL;
    > +
    > + action = kzalloc(sizeof(struct nmiaction), GFP_KERNEL);
    > + if (!action)
    > + return -ENOMEM;
    > +
    > + action->handler = handler;
    > + action->flags = nmiflags;
    > + action->name = devname;

    So you assume the string passed as devname remains stable..


    > +
    > + retval = __setup_nmi(type, action);
    > +
    > + if (retval)
    > + kfree(action);
    > +
    > + return retval;
    > +}
    > +EXPORT_SYMBOL(register_nmi_handler);

    Also, I'd use _GPL, the current register_die_notifier() is also.
    Preferably I'd not export NMI stuff at all.


    \
     
     \ /
      Last update: 2011-08-22 16:19    [W:0.022 / U:6.052 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site