Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <purvayeshi550@gmail.com>
Reviewed-by: Denis Efremov <efremov@linux.com>
Link: https://lore.kernel.org/r/20250713070020.14530-1-purvayeshi550@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Purva Yeshi and committed by
Jens Axboe
cb1bdf07 7e495382

+1 -1
+1 -1
drivers/block/floppy.c
··· 3411 3411 struct floppy_max_errors max_errors; 3412 3412 struct floppy_drive_params dp; 3413 3413 } 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 */ 3415 3415 3416 3416 /* convert compatibility eject ioctls into floppy eject ioctl. 3417 3417 * We do this in order to provide a means to eject floppy disks before