2021-03-10 03:33:06

by Jia-Ju Bai

[permalink] [raw]
Subject: [PATCH v2] 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 <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
---
v2:
* Drop wrong parts that make no sense.
Thank Jens Axboe for good advice.

---
drivers/block/rsxx/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index 63f549889f87..d7e2416112ec 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -869,6 +869,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;
}

--
2.17.1


2021-03-10 15:28:08

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH v2] block: rsxx: fix error return code of rsxx_pci_probe()

On 3/9/21 8:30 PM, Jia-Ju Bai wrote:
> 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.

Thanks, this looks much better. Applied.

--
Jens Axboe