linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] block: rsxx: fix error return code of rsxx_pci_probe()
@ 2021-03-10  3:30 Jia-Ju Bai
  2021-03-10 15:26 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-10  3:30 UTC (permalink / raw)
  To: josh.h.morris, pjk1939, axboe; +Cc: linux-block, linux-kernel, Jia-Ju Bai

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>
---
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] block: rsxx: fix error return code of rsxx_pci_probe()
  2021-03-10  3:30 [PATCH v2] block: rsxx: fix error return code of rsxx_pci_probe() Jia-Ju Bai
@ 2021-03-10 15:26 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-03-10 15:26 UTC (permalink / raw)
  To: Jia-Ju Bai, josh.h.morris, pjk1939; +Cc: linux-block, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-10 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10  3:30 [PATCH v2] block: rsxx: fix error return code of rsxx_pci_probe() Jia-Ju Bai
2021-03-10 15:26 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).