Messages in this thread | | | Subject | Re: [V2][PATCH 2/6] x86, nmi: create new NMI handler routines | From | Peter Zijlstra <> | Date | Wed, 24 Aug 2011 13:46:09 +0200 |
| |
On Tue, 2011-08-23 at 17:11 -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 = kstrndup(devname, NMI_MAX_NAMELEN, GFP_KERNEL); > + > + retval = __setup_nmi(type, action); > + > + if (retval) > + kfree(action);
you just leaked your kstrndup().
> + > + return retval; > +}
| |