Re: [V3][PATCH 2/6] x86, nmi: create new NMI handler routines

From: Don Zickus
Date: Tue Sep 06 2011 - 13:35:05 EST


On Tue, Sep 06, 2011 at 12:08:57PM +0200, Robert Richter wrote:
> 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.

Thanks.

Cheers,
Don
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/