Commit ac03334
block: floppy: fix uninitialized use of outparam in fd_locked_ioctl
Fix Smatch-detected error:
drivers/block/floppy.c:3569 fd_locked_ioctl() error:
uninitialized symbol 'outparam'.
Use the outparam pointer only after it is explicitly initialized.
Previously, fd_copyout() was called unconditionally after the switch-case
statement, assuming outparam would always be set when _IOC_READ was active.
However, not all paths ensured this, which led to potential use of an
uninitialized pointer.
Move fd_copyout() calls directly into the relevant case blocks immediately
after outparam is set. This ensures it is only called when safe and
applicable.
Signed-off-by: Purva Yeshi <[email protected]>1 parent 65e573f commit ac03334
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3482 | 3482 | | |
3483 | 3483 | | |
3484 | 3484 | | |
| 3485 | + | |
3485 | 3486 | | |
3486 | 3487 | | |
3487 | 3488 | | |
| |||
3515 | 3516 | | |
3516 | 3517 | | |
3517 | 3518 | | |
| 3519 | + | |
3518 | 3520 | | |
3519 | 3521 | | |
3520 | 3522 | | |
3521 | 3523 | | |
3522 | 3524 | | |
3523 | 3525 | | |
3524 | 3526 | | |
| 3527 | + | |
3525 | 3528 | | |
3526 | 3529 | | |
3527 | 3530 | | |
| |||
3531 | 3534 | | |
3532 | 3535 | | |
3533 | 3536 | | |
| 3537 | + | |
3534 | 3538 | | |
3535 | 3539 | | |
3536 | 3540 | | |
| |||
3541 | 3545 | | |
3542 | 3546 | | |
3543 | 3547 | | |
| 3548 | + | |
3544 | 3549 | | |
3545 | 3550 | | |
3546 | 3551 | | |
3547 | 3552 | | |
3548 | 3553 | | |
| 3554 | + | |
3549 | 3555 | | |
3550 | 3556 | | |
3551 | 3557 | | |
3552 | 3558 | | |
3553 | 3559 | | |
3554 | 3560 | | |
| 3561 | + | |
3555 | 3562 | | |
3556 | 3563 | | |
3557 | 3564 | | |
| |||
3565 | 3572 | | |
3566 | 3573 | | |
3567 | 3574 | | |
3568 | | - | |
3569 | | - | |
3570 | | - | |
3571 | 3575 | | |
3572 | 3576 | | |
3573 | 3577 | | |
| |||
0 commit comments