mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7615: Use kmemdup in mt7615_queue_key_update()
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
4e6f4e432d
commit
9ad940fee5
+1
-2
@@ -290,12 +290,11 @@ mt7615_queue_key_update(struct mt7615_dev *dev, enum set_key_cmd cmd,
|
||||
wd->type = MT7615_WTBL_KEY_DESC;
|
||||
wd->sta = msta;
|
||||
|
||||
wd->key.key = kzalloc(key->keylen, GFP_KERNEL);
|
||||
wd->key.key = kmemdup(key->key, key->keylen, GFP_KERNEL);
|
||||
if (!wd->key.key) {
|
||||
kfree(wd);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memcpy(wd->key.key, key->key, key->keylen);
|
||||
wd->key.cipher = key->cipher;
|
||||
wd->key.keyidx = key->keyidx;
|
||||
wd->key.keylen = key->keylen;
|
||||
|
||||
Reference in New Issue
Block a user