aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio_cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rapidio/rio_cm.c')
-rw-r--r--drivers/rapidio/rio_cm.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c
index cf45829585cb..50ec53d67a4c 100644
--- a/drivers/rapidio/rio_cm.c
+++ b/drivers/rapidio/rio_cm.c
@@ -1,19 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* rio_cm - RapidIO Channelized Messaging Driver
*
* Copyright 2013-2016 Integrated Device Technology, Inc.
* Copyright (c) 2015, Prodrive Technologies
* Copyright (c) 2015, RapidIO Trade Association
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
- * BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE
- * GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS.
*/
#include <linux/module.h>
@@ -2147,6 +2138,14 @@ static int riocm_add_mport(struct device *dev,
mutex_init(&cm->rx_lock);
riocm_rx_fill(cm, RIOCM_RX_RING_SIZE);
cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
+ if (!cm->rx_wq) {
+ riocm_error("failed to allocate IBMBOX_%d on %s",
+ cmbox, mport->name);
+ rio_release_outb_mbox(mport, cmbox);
+ kfree(cm);
+ return -ENOMEM;
+ }
+
INIT_WORK(&cm->rx_work, rio_ibmsg_handler);
cm->tx_slot = 0;