]> git.ipfire.org Git - thirdparty/linux.git/commit
pds_fwctl: Replace kzalloc + copy_from_user with memdup_user in pdsfc_fw_rpc
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 17 Sep 2025 15:09:41 +0000 (17:09 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 22 Sep 2025 13:33:10 +0000 (10:33 -0300)
commit479bec4cb39a1bfb2e5d3e3959d660f61399cad4
tree8770dcab1e4d2de3f0ba298ef2f0949110b98abf
parente7085be863839e3438fb67da65a74b64e99917e7
pds_fwctl: Replace kzalloc + copy_from_user with memdup_user in pdsfc_fw_rpc

Replace kzalloc() followed by copy_from_user() with memdup_user() to
improve and simplify pdsfc_fw_rpc().

Return early if an error occurs and remove the obsolete 'err_out' label.

No functional changes intended.

Link: https://patch.msgid.link/r/20250917150941.168887-1-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/fwctl/pds/main.c