block: rsxx: fix error return code of rsxx_pci_probe()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Wed, 10 Mar 2021 03:30:17 +0000 (19:30 -0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Mar 2021 15:25:37 +0000 (08:25 -0700)
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>
drivers/block/rsxx/core.c

index 5ac1881396afb135e74867e732be6e8943366afd..227e1be4c6f99e0f9d80615c375286d69333efd4 100644 (file)
@@ -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;
        }