From: "Rick L. Vinyard, Jr." <rvinyard@cs.nmsu.edu>
To: "Oliver Neukum" <oliver@neukum.org>
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: Mon, 25 Jan 2010 09:49:39 -0700 [thread overview]
Message-ID: <6ecc677422be02ef48fe8a00a34b8bd2.squirrel@intranet.cs.nmsu.edu> (raw)
In-Reply-To: <201001202227.31732.oliver@neukum.org>
Oliver Neukum wrote:
> 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.
>
Thanks for catching that one. I'll recheck all the rest of the allocs.
prev parent reply other threads:[~2010-01-25 16:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 20:47 Rick L. Vinyard Jr.
2010-01-20 21:19 ` Oliver Neukum
2010-01-25 16:48 ` Rick L. Vinyard, Jr.
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
2010-01-25 16:49 ` Rick L. Vinyard, Jr. [this message]
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=6ecc677422be02ef48fe8a00a34b8bd2.squirrel@intranet.cs.nmsu.edu \
--to=rvinyard@cs.nmsu.edu \
--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=oliver@neukum.org \
--cc=pavel@ucw.cz \
/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