Commit 0ac3c90
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: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Don Brace <don.brace@microchip.com>
Message-Id: <20250922201832.1697874-2-thorsten.blum@linux.dev>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent ac01fc4 commit 0ac3c90
1 file changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
6774 | 6775 | | |
6775 | 6776 | | |
6776 | 6777 | | |
6777 | | - | |
6778 | | - | |
6779 | | - | |
6780 | 6778 | | |
6781 | | - | |
6782 | | - | |
6783 | | - | |
6784 | | - | |
6785 | | - | |
| 6779 | + | |
| 6780 | + | |
| 6781 | + | |
| 6782 | + | |
6786 | 6783 | | |
6787 | | - | |
| 6784 | + | |
| 6785 | + | |
| 6786 | + | |
6788 | 6787 | | |
6789 | 6788 | | |
6790 | 6789 | | |
| |||
0 commit comments