lkml.org 
[lkml]   [2016]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] block: rsxx: set error code on exception path
Date
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 <bianpan2016@163.com>
---
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 34997df..925bc46 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -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;
}

--
1.9.1

\
 
 \ /
  Last update: 2016-12-01 04:09    [W:0.027 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site