Assert topology is held in g_dev_getprovider().
Don't call devsw(). It is not necessary, and we do not need to hold dev_lock to compare the devsw pointer to our own since we do not dereference it.
This commit is contained in:
parent
f69f5fbd42
commit
a7830346e2
@ -99,11 +99,13 @@ g_dev_getprovider(struct cdev *dev)
|
||||
{
|
||||
struct g_consumer *cp;
|
||||
|
||||
g_topology_assert();
|
||||
if (dev == NULL)
|
||||
return (NULL);
|
||||
if (devsw(dev) != &g_dev_cdevsw)
|
||||
return (NULL);
|
||||
cp = dev->si_drv2;
|
||||
if (dev->si_devsw != &g_dev_cdevsw)
|
||||
cp = NULL;
|
||||
else
|
||||
cp = dev->si_drv2;
|
||||
return (cp->provider);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user