linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] block: rsxx: set error code on exception path
@ 2016-12-01  2:53 Pan Bian
  0 siblings, 0 replies; only message in thread
From: Pan Bian @ 2016-12-01  2:53 UTC (permalink / raw)
  To: Joshua Morris, Philip Kelleher; +Cc: linux-kernel, Pan Bian

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-01  3:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01  2:53 [PATCH 1/1] block: rsxx: set error code on exception path Pan Bian

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