summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2021-03-09 19:30:17 -0800
committerJens Axboe <axboe@kernel.dk>2021-03-10 08:25:37 -0700
commitdf66617bfe87487190a60783d26175b65d2502ce (patch)
tree603f9df247e061c0e692457481bc3456c11d1729
parentfaa44c69daf9ccbd5b8a1aee13e0e0d037c0be17 (diff)
downloadlinux-df66617bfe87487190a60783d26175b65d2502ce.tar.gz
linux-df66617bfe87487190a60783d26175b65d2502ce.tar.bz2
linux-df66617bfe87487190a60783d26175b65d2502ce.zip
block: rsxx: fix error return code of rsxx_pci_probe()
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>
-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;
}