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

scsi: smartpqi: Replace kmalloc() + copy_from_user() with memdup_user()



Replace kmalloc() followed by copy_from_user() with memdup_user() to
simplify and improve pqi_passthru_ioctl().

Since memdup_user() already allocates memory, use kzalloc() in the else
branch instead of manually zeroing 'kernel_buffer' using memset(0).

Return early if an error occurs.  No functional changes intended.

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