block: rsxx: set error code on exception path
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.
Signed-off-by Pan Bian <[email protected]>
--- drivers/block/rsxx/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/rsxx/core.c +1 -0
@@ -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