lkml.org 
[lkml]   [2011]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [V3][PATCH 2/6] x86, nmi: create new NMI handler routines
On 25.08.11 12:45:44, 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);

Null pointer check is missing here.

> +
> + retval = __setup_nmi(type, action);
> +
> + if (retval) {
> + kfree(action->name);
> + kfree(action);
> + }
> +
> + return retval;
> +}
> +EXPORT_SYMBOL_GPL(register_nmi_handler);

--
Advanced Micro Devices, Inc.
Operating System Research Center



\
 
 \ /
  Last update: 2011-09-06 12:11    [W:0.157 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site