]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet-tcp: fix uninitialized variable access
authorSagi Grimberg <sagi@grimberg.me>
Wed, 9 Jan 2019 22:56:32 +0000 (14:56 -0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Jan 2019 16:44:20 +0000 (09:44 -0700)
commit2a83bbe90e4478c6e8188db74b1a56b8c912ce50
tree54daa9c491a674d10278ecbd602be78872663e09
parent9a1de334053e4a5bfb27689385c4a4e91dd6f244
nvmet-tcp: fix uninitialized variable access

If we end up in nvmet_tcp_try_recv_one with a bogus state
queue receive state we will access result which is uninitialized.

Initialize restult to 0 which will be considered as if no data
was received by the tcp socket.

Fixes: 82a5e0cb5a13 ("nvmet-tcp: add NVMe over TCP target driver")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/tcp.c