An OS could decide to not pass any environment variables to hotplug scripts,
and this will trigger a bug in device_hotplug logic, since it expects the
environment array to exist. Allow env to be NULL.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
goto out;
}
+ assert(args != NULL);
LOG(DEBUG, "calling hotplug script: %s %s", args[0], args[1]);
LOG(DEBUG, "extra args:");
{
LOG(DEBUG, "\t%s", arg);
}
LOG(DEBUG, "env:");
- {
+ if (env != NULL) {
const char *k, *v;
unsigned int x;