VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Thierry Reding <treding@nvidia.com> 2014-12-18 15:06:56 +0100 committer: Thierry Reding <treding@nvidia.com> 2015-01-23 12:07:01 +0100 commit: 38d98de4332fcdaa72fc83443c1e3268e4b2214b parent: 536e1715226c94037df12f7c6280cbe0f6009f92
Commit Summary:
gpu: host1x: Call host1x_device_add() under lock
Diffstat:
1 file changed, 1 insertion, 4 deletions
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index e4182e68e29c..769116dba797 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -323,9 +323,7 @@ static int host1x_device_add(struct host1x *host1x,
 		return err;
 	}
 
-	mutex_lock(&host1x->devices_lock);
 	list_add_tail(&device->list, &host1x->devices);
-	mutex_unlock(&host1x->devices_lock);
 
 	mutex_lock(&clients_lock);
 
@@ -414,11 +412,11 @@ static void host1x_attach_driver(struct host1x *host1x,
 		}
 	}
 
-	mutex_unlock(&host1x->devices_lock);
-
 	err = host1x_device_add(host1x, driver);
 	if (err < 0)
 		dev_err(host1x->dev, "failed to allocate device: %d\n", err);
+
+	mutex_unlock(&host1x->devices_lock);
 }
 
 static void host1x_detach_driver(struct host1x *host1x,