[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190319172122.8714-1-pakki001@umn.edu>
Date: Tue, 19 Mar 2019 12:21:22 -0500
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] thunderbolt: Fix to check return value of ida_simple_get
ida_simple_get on failure can return an error. The patch ensures that
the dev_set_name is set on non failure cases.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/thunderbolt/xdomain.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c
index e27dd8beb94b..bd3633e31359 100644
--- a/drivers/thunderbolt/xdomain.c
+++ b/drivers/thunderbolt/xdomain.c
@@ -772,7 +772,9 @@ static void enumerate_services(struct tb_xdomain *xd)
svc->dev.bus = &tb_bus_type;
svc->dev.type = &tb_service_type;
svc->dev.parent = &xd->dev;
- dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev), svc->id);
+ if (sv->id >= 0)
+ dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev),
+ svc->id);
if (device_register(&svc->dev)) {
put_device(&svc->dev);
--
2.17.1
Powered by blists - more mailing lists