fastboot: Check validity of dev_path

In some occations dev_path is not valid and we therefor can't
dereference it. Check for this and ignore any events without a dev_path.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2018-02-27 15:33:55 -08:00
parent d36b49e6fb
commit 48d186f3d0

View File

@@ -240,7 +240,7 @@ static int handle_udev_event(int fd, void *data)
// pid = udev_device_get_sysattr_value(dev, "idProduct");
serial = udev_device_get_sysattr_value(dev, "serial");
if (!action)
if (!action || !dev_path)
goto unref_dev;
if (!strcmp(action, "add")) {