lkml.org 
[lkml]   [2010]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] hid: Logitech G13 driver 0.0.4
From
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.





\
 
 \ /
  Last update: 2010-01-25 18:01    [W:0.083 / U:1.960 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site