1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

Only lock Giant when needed in the LinuxKPI.

Suggested by:	ngie @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2016-05-16 17:41:25 +00:00
parent daa0dffb21
commit 0f9f74597d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299960

View File

@ -333,10 +333,11 @@ device_unregister(struct device *dev)
bsddev = dev->bsddev;
dev->bsddev = NULL;
mtx_lock(&Giant);
if (bsddev != NULL)
if (bsddev != NULL) {
mtx_lock(&Giant);
device_delete_child(device_get_parent(bsddev), bsddev);
mtx_unlock(&Giant);
mtx_unlock(&Giant);
}
put_device(dev);
}
@ -348,10 +349,11 @@ device_del(struct device *dev)
bsddev = dev->bsddev;
dev->bsddev = NULL;
mtx_lock(&Giant);
if (bsddev != NULL)
if (bsddev != NULL) {
mtx_lock(&Giant);
device_delete_child(device_get_parent(bsddev), bsddev);
mtx_unlock(&Giant);
mtx_unlock(&Giant);
}
}
struct device *device_create(struct class *class, struct device *parent,