lkml.org 
[lkml]   [2016]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] watchdog: ziirave_wdt: Add support to upload the firmware.
From
Date
On 07/21/2016 01:59 AM, Enric Balletbo Serra wrote:

[ ... ]

>>>
>>> +static ssize_t ziirave_wdt_sysfs_store_firm(struct device *dev,
>>> + struct device_attribute *attr,
>>> + const char *buf, size_t count)
>>> +{
>>> + struct i2c_client *client = to_i2c_client(dev->parent);
>>> + struct ziirave_wdt_data *w_priv = i2c_get_clientdata(client);
>>> + const struct firmware *fw;
>>> + int err;
>>> +
>>
>>
>> What happens if this file is opened twice and written in parallel ?
>> What if any
>> other attribute is accessed while the firmware download is ongoing ?
>>
>
> Good point. So you think I need to protect all with mutexes or there

Yes, you have to protect any possible damaging parallel access with mutexes.

> is another way? From a quick look on other drivers i didn't see this
> kind of protection (something to look at in the future)
>

Really ? Can you point me to some examples ? This would be a bug.

You'll have to fix the to get your patch accepted. Pointing to other
examples with the same or a similar bug is not an argument.

Thanks,
Guenter

\
 
 \ /
  Last update: 2016-07-21 16:01    [W:0.046 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site