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:
> +static struct nmiaction *__free_nmi(unsigned int type, const char *name)
> +{
> + struct nmi_desc *desc = nmi_to_desc(type);
> + struct nmiaction *n, **np = &(desc->head);
> + unsigned long flags;
> +
> + spin_lock_irqsave(&desc->lock, flags);
> +
...
> +
> + spin_unlock_irqrestore(&desc->lock, flags);
> + synchronize_rcu();
> + return *np;
> +}

> +void unregister_nmi_handler(unsigned int type, const char *name)
> +{
> + kfree(__free_nmi(type, name));
> +}

This code is weird.. why not have the kfree() in __free_nmi(), also why
use sync_rcu() and not use kfree_rcu()?

> +EXPORT_SYMBOL_GPL(unregister_nmi_handler);

*g*, so binary modules can register an NMI handler, but can't unregister
it..?


\
 
 \ /
  Last update: 2011-08-22 16:19    [W:0.126 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site