Skip to contentSkip to conversation

block: rsxx: set error code on exception path

PATCH New Pan Bian 1 participant 1 message Dec 1, 2016 Block layer

lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 block: rsxx: set error code on exception path

Fix bug https://bugzilla.kernel.org/show_bug.cgi?id=188541. In function rsxx_pci_probe(), variable st takes the return value. Its value should be negative on failures. However, the value of st is 0 even if the call to create_singlethread_workqueue() returns a NULL pointer. This patch fixes the bug by assigning -ENOMEM to st when the call fails.

---
 drivers/block/rsxx/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/rsxx/core.c +1 -0
index 34997df..925bc46 100644
@@ -890,6 +890,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;
 	}
 
Signature · 1 line
1.9.1