summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2021-03-10 06:30:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-17 19:06:33 +0300
commitd1d918492e6e25a65192dff1da75cbf957ed20a7 (patch)
treeb6fbcdb1afeca8a9c29f0a8d85c3d6c59933b09c
parentcaa86901c863e7c3646d189f2deb9e844afd0568 (diff)
downloadlinux-d1d918492e6e25a65192dff1da75cbf957ed20a7.tar.xz
block: rsxx: fix error return code of rsxx_pci_probe()
[ Upstream commit df66617bfe87487190a60783d26175b65d2502ce ] When create_singlethread_workqueue returns NULL to card->event_wq, no error return code of rsxx_pci_probe() is assigned. To fix this bug, st is assigned with -ENOMEM in this case. Fixes: 8722ff8cdbfa ("block: IBM RamSan 70/80 device driver") Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Link: https://lore.kernel.org/r/20210310033017.4023-1-baijiaju1990@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/block/rsxx/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index 5ac1881396af..227e1be4c6f9 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -871,6 +871,7 @@ static int rsxx_pci_probe(struct pci_dev *dev,
card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event");
if (!card->event_wq) {
dev_err(CARD_TO_DEV(card), "Failed card event setup.\n");
+ st = -ENOMEM;
goto failed_event_handler;
}