Re: [PATCH RESEND] scsi: hpsa: Replace kmalloc + copy_from_user with memdup_user

From: Martin K. Petersen
Date: Wed Sep 24 2025 - 21:42:19 EST



Thorsten,

> 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.

Applied to 6.18/scsi-staging, thanks!

--
Martin K. Petersen