Skip to content

Commit cb1bdf0

Browse files
Purva Yeshiaxboe
authored andcommitted
block: floppy: Fix uninitialized use of outparam
Fix Smatch-detected error: drivers/block/floppy.c:3569 fd_locked_ioctl() error: uninitialized symbol 'outparam'. Smatch may incorrectly warn about uninitialized use of 'outparam' in fd_locked_ioctl(), even though all _IOC_READ commands guarantee its initialization. Initialize outparam to NULL to make this explicit and suppress the false positive. Signed-off-by: Purva Yeshi <[email protected]> Reviewed-by: Denis Efremov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 7e49538 commit cb1bdf0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/block/floppy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,7 @@ static int fd_locked_ioctl(struct block_device *bdev, blk_mode_t mode,
34113411
struct floppy_max_errors max_errors;
34123412
struct floppy_drive_params dp;
34133413
} inparam; /* parameters coming from user space */
3414-
const void *outparam; /* parameters passed back to user space */
3414+
const void *outparam = NULL; /* parameters passed back to user space */
34153415

34163416
/* convert compatibility eject ioctls into floppy eject ioctl.
34173417
* We do this in order to provide a means to eject floppy disks before

0 commit comments

Comments
 (0)