]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix sqhd reference when admin queue connect fails
authorJames Smart <jsmart2021@gmail.com>
Thu, 21 Sep 2017 15:13:49 +0000 (08:13 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Sep 2017 18:42:11 +0000 (12:42 -0600)
commit83e8d6b2191966b225fdb370c88fddfdf5c7c524
treeb152e6d500ae8aa28866a80f9dd4d6dd893d11f0
parent6611f30f13d8226297239d6a184d4482d15c0ffc
nvme: fix sqhd reference when admin queue connect fails

Fix bug in sqhd patch.

It wasn't the sq that was at risk. In the case where the admin queue
connect command fails, the sq->size field is not set. Therefore, this
becomes a divide by zero error.

Add a quick check to bypass under this failure condition.

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/core.c