]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: fix incorrect check on failed workqueue create
authorColin Ian King <colin.king@canonical.com>
Thu, 30 Jul 2020 08:20:22 +0000 (09:20 +0100)
committerOded Gabbay <oded.gabbay@gmail.com>
Sat, 22 Aug 2020 09:47:58 +0000 (12:47 +0300)
commite9663c23e92223dd854b8526cd1bad3ee8d12cd6
tree0073a2ec0bb20a0404870bc8e1f8cacd65866055
parent95a2c431cd450db6b07d129475238ac91f989832
habanalabs: fix incorrect check on failed workqueue create

The null check on a failed workqueue create is currently null checking
hdev->cq_wq rather than the pointer hdev->cq_wq[i] and so the test
will never be true on a failed workqueue create. Fix this by checking
hdev->cq_wq[i].

Addresses-Coverity: ("Dereference before null check")
Fixes: 9feff75581ad ("habanalabs: Assign each CQ with its own work queue")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/common/device.c