]> 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)
commit232a087615e14f05033524f8fd29360abd2f8ad9
tree0073a2ec0bb20a0404870bc8e1f8cacd65866055
parentfefb2a728a39dea40a6a22c7d8530698745979f2
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: 9f119a091530 ("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