Commit ac01fc41 authored by Thorsten Blum's avatar Thorsten Blum Committed by Martin K. Petersen
Browse files

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: default avatarThorsten Blum <thorsten.blum@linux.dev>
Acked-by: default avatarDon Brace <don.brace@microchip.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b8129659
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment