mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
udev: do not read UdevEvent object before checking it is non-NULL
This commit is contained in:
parent
589384be8d
commit
6d0fdf4513
@ -821,13 +821,15 @@ int udev_event_execute_rules(UdevEvent *event,
|
||||
usec_t timeout_usec,
|
||||
Hashmap *properties_list,
|
||||
UdevRules *rules) {
|
||||
sd_device *dev = event->dev;
|
||||
const char *subsystem, *action;
|
||||
sd_device *dev;
|
||||
int r;
|
||||
|
||||
assert(event);
|
||||
assert(rules);
|
||||
|
||||
dev = event->dev;
|
||||
|
||||
r = sd_device_get_subsystem(dev, &subsystem);
|
||||
if (r < 0)
|
||||
return log_device_error_errno(dev, r, "Failed to get subsystem: %m");
|
||||
|
Loading…
x
Reference in New Issue
Block a user