mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
efi/efi_test: Use memdup_user() as a cleanup
Fix coccicheck warning which recommends to use memdup_user(). This patch fixes the following coccicheck warnings: drivers/firmware/efi/test/efi_test.c:269:8-15: WARNING opportunity for memdup_user Signed-off-by: Ivan Hu <[email protected]> Signed-off-by: Matt Fleming <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Ivan Khoronzhuk <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
9c30a21993
commit
c208ed916e
1 changed files with 3 additions and 7 deletions
|
|
@ -265,14 +265,10 @@ static long efi_runtime_set_variable(unsigned long arg)
|
|||
return rv;
|
||||
}
|
||||
|
||||
data = kmalloc(setvariable.data_size, GFP_KERNEL);
|
||||
if (!data) {
|
||||
data = memdup_user(setvariable.data, setvariable.data_size);
|
||||
if (IS_ERR(data)) {
|
||||
kfree(name);
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (copy_from_user(data, setvariable.data, setvariable.data_size)) {
|
||||
rv = -EFAULT;
|
||||
goto out;
|
||||
return PTR_ERR(data);
|
||||
}
|
||||
|
||||
status = efi.set_variable(name, &vendor_guid,
|
||||
|
|
|
|||
Loading…
Reference in a new issue