linux/drivers/block
Nathan Chancellor 17bc10300c block/rnbd: Ensure err is always initialized in process_rdma
Clang warns:

drivers/block/rnbd/rnbd-srv.c:150:6: warning: variable 'err' is used
uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
        if (IS_ERR(bio)) {
            ^~~~~~~~~~~
drivers/block/rnbd/rnbd-srv.c:177:9: note: uninitialized use occurs here
        return err;
               ^~~
drivers/block/rnbd/rnbd-srv.c:150:2: note: remove the 'if' if its
condition is always false
        if (IS_ERR(bio)) {
        ^~~~~~~~~~~~~~~~~~
drivers/block/rnbd/rnbd-srv.c:126:9: note: initialize the variable 'err'
to silence this warning
        int err;
               ^
                = 0
1 warning generated.

err is indeed uninitialized when this statement is taken. Ensure that it
is assigned the error value of bio before jumping to the error handling
label.

Fixes: 735d77d4fd ("rnbd: remove rnbd_dev_submit_io")
Reported-by: Brooke Basile <brookebasile@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1134
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-21 17:09:11 -06:00
..
aoe bdi: fix up for "remove the name field in struct backing_dev_info" 2020-05-11 09:08:26 -06:00
drbd This tree adds the sched_set_fifo*() encapsulation APIs to remove 2020-08-06 11:55:43 -07:00
mtip32xx blk-mq: move failure injection out of blk_mq_complete_request 2020-06-24 09:15:57 -06:00
paride treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
rnbd block/rnbd: Ensure err is always initialized in process_rdma 2020-08-21 17:09:11 -06:00
rsxx pci-v5.9-changes 2020-08-07 18:48:15 -07:00
xen-blkback mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
zram for-5.9/block-20200802 2020-08-03 11:57:03 -07:00
amiflop.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
ataflop.c ataflop: Remove unneeded semicolon 2019-11-28 10:40:47 -07:00
brd.c block: move ->make_request_fn to struct block_device_operations 2020-07-01 07:27:24 -06:00
cryptoloop.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 30 2019-05-24 17:27:10 +02:00
floppy.c floppy: use block_size 2020-07-01 08:08:08 -06:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
loop.c block: loop: set discard granularity and alignment for block device backed loop 2020-08-17 06:58:36 -07:00
loop.h block/loop: Use global lock for ioctl() operation. 2018-11-08 06:30:11 -07:00
Makefile block/rnbd: include client and server modules into kernel compilation 2020-05-17 18:57:17 -03:00
nbd.c for-5.9/block-20200802 2020-08-03 11:57:03 -07:00
null_blk_main.c null_blk: introduce zone capacity for zoned device 2020-07-08 16:16:19 +02:00
null_blk_trace.c null_blk: add tracepoint helpers for zoned mode 2020-03-27 13:39:10 -06:00
null_blk_trace.h null_blk: add tracepoint helpers for zoned mode 2020-03-27 13:39:10 -06:00
null_blk_zoned.c null_blk: introduce zone capacity for zoned device 2020-07-08 16:16:19 +02:00
null_blk.h null_blk: introduce zone capacity for zoned device 2020-07-08 16:16:19 +02:00
pktcdvd.c block: rename generic_make_request to submit_bio_noacct 2020-07-01 07:27:24 -06:00
ps3disk.c ps3disk: use the default segment boundary 2020-05-19 00:10:35 +10:00
ps3vram.c block: move ->make_request_fn to struct block_device_operations 2020-07-01 07:27:24 -06:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
rbd.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
skd_main.c blk-mq: move failure injection out of blk_mq_complete_request 2020-06-24 09:15:57 -06:00
skd_s1120.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
sunvdc.c compat_ioctl: block: handle cdrom compat ioctl in non-cdrom drivers 2020-01-03 09:33:15 +01:00
swim3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim.c block/swim3: use set_current_state macro 2020-05-16 14:28:37 -06:00
sx8.c sx8: use a per-host tag_set 2018-11-09 08:14:14 -07:00
umem.c block: move ->make_request_fn to struct block_device_operations 2020-07-01 07:27:24 -06:00
umem.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 348 2019-06-05 17:37:08 +02:00
virtio_blk.c block: virtio_blk: fix handling single range discard request 2020-08-17 06:59:41 -07:00
xen-blkfront.c blk-mq: move failure injection out of blk_mq_complete_request 2020-06-24 09:15:57 -06:00
xsysace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
z2ram.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00