]> www.infradead.org Git - users/jedix/linux-maple.git/commit
platform/x86/amd/pmf: Use memdup_user()
authorThorsten Blum <thorsten.blum@toblux.com>
Mon, 27 May 2024 08:36:29 +0000 (10:36 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 27 May 2024 10:11:21 +0000 (13:11 +0300)
commit46de513068f956b76d68d241a7ad6bc5576d2948
tree4f53c6a4dff248ef10b20a9bbe838c5f9eb7616c
parent1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
platform/x86/amd/pmf: Use memdup_user()

Switch to memdup_user() to overwrite the allocated memory only once
instead of initializing the allocated memory to zero with kzalloc() and
then immediately overwriting it with copy_from_user().

Fixes the following Coccinelle/coccicheck warning reported by
memdup_user.cocci:

WARNING opportunity for memdup_user

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Link: https://lore.kernel.org/r/20240527083628.210491-2-thorsten.blum@toblux.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/pmf/tee-if.c