From: Oliver Neukum <oliver@neukum.org>
To: "Rick L. Vinyard Jr." <rvinyard@cs.nmsu.edu>
Cc: linux-kernel@vger.kernel.org, felipe.balbi@nokia.com,
pavel@ucw.cz, jayakumar.lkml@gmail.com,
linux-fbdev@vger.kernel.org, krzysztof.h1@wp.pl,
akpm@linux-foundation.org, linux-usb@vger.kernel.org,
linux-input@vger.kernel.org, jkosina@suse.cz,
dmitry.torokhov@gmail.com
Subject: Re: [PATCH] hid: Logitech G13 driver 0.0.4
Date: Wed, 20 Jan 2010 21:27:31 +0000 [thread overview]
Message-ID: <201001202227.31732.oliver@neukum.org> (raw)
In-Reply-To: <201001202047.o0KKlMTr014003@mustang.cs.nmsu.edu>
Am Mittwoch, 20. Januar 2010 21:47:22 schrieb Rick L. Vinyard Jr.:
> +static ssize_t g13_name_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct g13_data *data = dev_get_drvdata(dev);
> + size_t limit = count;
> + char *end;
> +
> + spin_lock(&data->lock);
> +
> + if (data->name != NULL) {
> + kfree(data->name);
> + data->name = NULL;
> + }
> +
> + end = strpbrk(buf, "\n\r");
> + if (end != NULL)
> + limit = end - buf;
> +
> + if (end != buf) {
> +
> + if (limit > 100)
> + limit = 100;
> +
> + data->name = kzalloc(limit+1, GFP_KERNEL);
While you hold a spinlock, memory allocations must be done with GFP_ATOMIC.
Regards
Oliver
next prev parent reply other threads:[~2010-01-20 21:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 20:47 [PATCH] hid: Logitech G13 driver 0.0.4 Rick L. Vinyard Jr.
2010-01-20 21:19 ` Oliver Neukum
2010-01-25 16:48 ` Rick L. Vinyard, Jr.
[not found] ` <acd6dfcf4391c081f861d430c0b45311.squirrel-2xSMGd46i5akveL4JqN78fZ8FUJU4vz8@public.gmane.org>
2010-01-25 16:59 ` Jiri Kosina
2010-01-25 18:02 ` Rick L. Vinyard, Jr.
2010-01-28 7:24 ` Pavel Machek
2010-01-28 7:47 ` Oliver Neukum
2010-01-20 21:27 ` Oliver Neukum [this message]
[not found] ` <201001202227.31732.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2010-01-25 16:49 ` Rick L. Vinyard, Jr.
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=201001202227.31732.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=akpm@linux-foundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=felipe.balbi@nokia.com \
--cc=jayakumar.lkml@gmail.com \
--cc=jkosina@suse.cz \
--cc=krzysztof.h1@wp.pl \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rvinyard@cs.nmsu.edu \
/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;
as well as URLs for NNTP newsgroup(s).