linux/drivers/lightnvm
Geert Uytterhoeven 2f5af4ab7d lightnvm: fix uninitialized pointer in nvm_remove_tgt()
With gcc 4.1:

    drivers/lightnvm/core.c: In function ‘nvm_remove_tgt’:
    drivers/lightnvm/core.c:510: warning: ‘t’ is used uninitialized in this function

Indeed, if no NVM devices have been registered, t will be an
uninitialized pointer, and may be dereferenced later.  A call to
nvm_remove_tgt() can be triggered from userspace by issuing the
NVM_DEV_REMOVE ioctl on the lightnvm control device.

Fix this by preinitializing t to NULL.

Fixes: 843f2edbdd ("lightnvm: do not remove instance under global lock")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-06-21 03:14:30 -06:00
..
core.c lightnvm: fix uninitialized pointer in nvm_remove_tgt() 2019-06-21 03:14:30 -06:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
pblk-cache.c lightnvm: pblk: IO path reorganization 2019-05-06 10:19:19 -06:00
pblk-core.c lightnvm: pblk: fix freeing of merged pages 2019-06-21 03:14:29 -06:00
pblk-gc.c lightnvm: pblk: GC error handling 2019-05-06 10:19:18 -06:00
pblk-init.c lightnvm: pblk: IO path reorganization 2019-05-06 10:19:19 -06:00
pblk-map.c lightnvm: pblk: ensure that erase is chunk aligned 2019-05-06 10:19:17 -06:00
pblk-rb.c lightnvm: pblk: simplify partial read path 2019-05-06 10:19:19 -06:00
pblk-read.c lightnvm: pblk: simplify partial read path 2019-05-06 10:19:19 -06:00
pblk-recovery.c lightnvm: pblk: use nvm_rq_to_ppa_list() 2019-05-06 10:19:19 -06:00
pblk-rl.c pblk: fix max_io calculation 2019-03-07 08:59:26 -07:00
pblk-sysfs.c lightnvm: pblk: support packed metadata 2018-12-11 12:22:35 -07:00
pblk-trace.h lightnvm: pblk: fix TRACE_INCLUDE_PATH 2019-02-11 08:18:07 -07:00
pblk-write.c lightnvm: pblk: kick writer on write recovery path 2019-05-06 10:19:18 -06:00
pblk.h lightnvm: pblk: simplify partial read path 2019-05-06 10:19:19 -06:00