diff options
| author | 2025-09-23 19:15:04 +0200 | |
|---|---|---|
| committer | 2025-09-24 21:41:24 -0400 | |
| commit | ac01fc418f586c6a6e5582da16de7324e9c6391a (patch) | |
| tree | c0f736af220bbb5f0f342dda9a4d22463509851a /drivers/cdx/controller/cdx_controller.c | |
| parent | scsi: hpsa: Fix potential memory leak in hpsa_big_passthru_ioctl() (diff) | |
| download | linux-rng-ac01fc418f586c6a6e5582da16de7324e9c6391a.tar.xz linux-rng-ac01fc418f586c6a6e5582da16de7324e9c6391a.zip | |
scsi: hpsa: Replace kmalloc() + copy_from_user() with memdup_user()
Replace kmalloc() followed by copy_from_user() with memdup_user() to
improve and simplify hpsa_passthru_ioctl().
Since memdup_user() already allocates memory, use kzalloc() in the else
branch instead of manually zeroing 'buff' using memset(0).
Return early if an error occurs and remove the 'out_kfree' label.
No functional changes intended.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/cdx/controller/cdx_controller.c')
0 files changed, 0 insertions, 0 deletions
