When make_dev_credf(MAKEDEV_WAITOK) is called, use
devctl_notify_f(M_WAITOK) for devfs notifications. Suggested by: jh Reviewed by: imp, jh MFC after: 3 weeks
This commit is contained in:
parent
bebc339116
commit
76d43557d8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209105
@ -509,18 +509,18 @@ notify(struct cdev *dev, const char *ev, int flags)
|
||||
{
|
||||
static const char prefix[] = "cdev=";
|
||||
char *data;
|
||||
int namelen;
|
||||
int namelen, mflags;
|
||||
|
||||
if (cold)
|
||||
return;
|
||||
mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK;
|
||||
namelen = strlen(dev->si_name);
|
||||
data = malloc(namelen + sizeof(prefix), M_TEMP,
|
||||
(flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK);
|
||||
data = malloc(namelen + sizeof(prefix), M_TEMP, mflags);
|
||||
if (data == NULL)
|
||||
return;
|
||||
memcpy(data, prefix, sizeof(prefix) - 1);
|
||||
memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1);
|
||||
devctl_notify("DEVFS", "CDEV", ev, data);
|
||||
devctl_notify_f("DEVFS", "CDEV", ev, data, mflags);
|
||||
free(data, M_TEMP);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user