mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 14:40:53 +07:00
[media] drxd: 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: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
d1190024f0
commit
53090aada4
@ -914,14 +914,13 @@ static int load_firmware(struct drxd_state *state, const char *fw_name)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
state->microcode = kmalloc(fw->size, GFP_KERNEL);
|
||||
state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL);
|
||||
if (state->microcode == NULL) {
|
||||
release_firmware(fw);
|
||||
printk(KERN_ERR "drxd: firmware load failure: no memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memcpy(state->microcode, fw->data, fw->size);
|
||||
state->microcode_length = fw->size;
|
||||
release_firmware(fw);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user