From: Peter Zijlstra <peterz@infradead.org>
To: Don Zickus <dzickus@redhat.com>
Cc: x86@kernel.org, Andi Kleen <andi@firstfloor.org>,
Robert Richter <robert.richter@amd.com>,
ying.huang@intel.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [V2][PATCH 2/6] x86, nmi: create new NMI handler routines
Date: Wed, 24 Aug 2011 13:46:09 +0200 [thread overview]
Message-ID: <1314186369.24121.8.camel@twins> (raw)
In-Reply-To: <1314133866-30915-3-git-send-email-dzickus@redhat.com>
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;
> +}
next prev parent reply other threads:[~2011-08-24 11:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-23 21:11 [V2][PATCH 0/6] x86, nmi: new NMI handling routines Don Zickus
2011-08-23 21:11 ` [V2][PATCH 1/6] x86, nmi: split out nmi from traps.c Don Zickus
2011-08-23 21:11 ` [V2][PATCH 2/6] x86, nmi: create new NMI handler routines Don Zickus
2011-08-24 11:46 ` Peter Zijlstra [this message]
2011-08-23 21:11 ` [V2][PATCH 3/6] x86, nmi: wire up NMI handlers to new routines Don Zickus
2011-08-23 21:11 ` [V2][PATCH 4/6] x86, nmi: add in logic to handle multiple events and unknown NMIs Don Zickus
2011-08-23 21:11 ` [V2][PATCH 5/6] x86, nmi: track NMI usage stats Don Zickus
2011-08-23 21:11 ` [V2][PATCH 6/6] x86, nmi: print out NMI stats in /proc/interrupts Don Zickus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314186369.24121.8.camel@twins \
--to=peterz@infradead.org \
--cc=andi@firstfloor.org \
--cc=dzickus@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.richter@amd.com \
--cc=x86@kernel.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome