|
@@ -411,11 +411,13 @@ static ssize_t synth_direct_store(struct kobject *kobj,
|
|
int len;
|
|
int len;
|
|
int bytes;
|
|
int bytes;
|
|
const char *ptr = buf;
|
|
const char *ptr = buf;
|
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
if (!synth)
|
|
if (!synth)
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
|
|
|
len = strlen(buf);
|
|
len = strlen(buf);
|
|
|
|
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
|
|
while (len > 0) {
|
|
while (len > 0) {
|
|
bytes = min_t(size_t, len, 250);
|
|
bytes = min_t(size_t, len, 250);
|
|
strncpy(tmp, ptr, bytes);
|
|
strncpy(tmp, ptr, bytes);
|
|
@@ -425,6 +427,7 @@ static ssize_t synth_direct_store(struct kobject *kobj,
|
|
ptr += bytes;
|
|
ptr += bytes;
|
|
len -= bytes;
|
|
len -= bytes;
|
|
}
|
|
}
|
|
|
|
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
|
return count;
|
|
return count;
|
|
}
|
|
}
|
|
|
|
|