mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-14 09:09:56 +00:00
Staging: speakup: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
cd420765eb
commit
1aa5eb67d7
@ -265,12 +265,11 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
unsigned long flags;
|
||||
|
||||
spk_lock(flags);
|
||||
in_buff = kmalloc(count + 1, GFP_ATOMIC);
|
||||
in_buff = kmemdup(buf, count + 1, GFP_ATOMIC);
|
||||
if (!in_buff) {
|
||||
spk_unlock(flags);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memcpy(in_buff, buf, count + 1);
|
||||
if (strchr("dDrR", *in_buff)) {
|
||||
set_key_info(key_defaults, key_buf);
|
||||
pr_info("keymap set to default values\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user