Re: [PATCH] scsi: smartpqi: Replace kmalloc + copy_from_user with memdup_user
From: Martin K. Petersen
Date: Tue Sep 30 2025 - 00:11:58 EST
On Mon, 22 Sep 2025 22:18:33 +0200, Thorsten Blum wrote:
> 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.
>
> [...]
Applied to 6.18/scsi-queue, thanks!
[1/1] scsi: smartpqi: Replace kmalloc + copy_from_user with memdup_user
https://git.kernel.org/mkp/scsi/c/0ac3c901fbeb
--
Martin K. Petersen