Commit ac01fc4
scsi: hpsa: Replace kmalloc() + copy_from_user() with memdup_user()
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.
No functional changes intended.
Signed-off-by: Thorsten Blum <[email protected]>
Acked-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent b812965 commit ac01fc4
1 file changed
+6
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6402 | 6402 | | |
6403 | 6403 | | |
6404 | 6404 | | |
6405 | | - | |
6406 | | - | |
6407 | | - | |
6408 | 6405 | | |
6409 | | - | |
6410 | | - | |
6411 | | - | |
6412 | | - | |
6413 | | - | |
6414 | | - | |
| 6406 | + | |
| 6407 | + | |
| 6408 | + | |
6415 | 6409 | | |
6416 | | - | |
| 6410 | + | |
| 6411 | + | |
| 6412 | + | |
6417 | 6413 | | |
6418 | 6414 | | |
6419 | 6415 | | |
| |||
6473 | 6469 | | |
6474 | 6470 | | |
6475 | 6471 | | |
6476 | | - | |
6477 | 6472 | | |
6478 | 6473 | | |
6479 | 6474 | | |
| |||
0 commit comments