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 <[email protected]>
Acked-by: Don Brace <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent ac01fc4 commit 0ac3c90
1 file changed
+8
-9
lines changed| 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