chiark / gitweb /
udev: fix segfault with android rndis
authorRob Clark <robdclark@gmail.com>
Sun, 3 Mar 2013 17:55:08 +0000 (12:55 -0500)
committerKay Sievers <kay@vrfy.org>
Sun, 3 Mar 2013 18:02:36 +0000 (19:02 +0100)
The android gadget driver for network tethering over rndis somehow has a
parent device with a null subsystem.  Probably this is bug in android driver,
but it is easy enough to make systemd/udev behave gracefully and not
segfault.  And this will help for making linux distros with systemd
(like fedora) work on android devices.

src/udev/udev-builtin-net_id.c

index fbacb45877e99c4cbfc6ff9a0df68f15e645a477..fdbec5ae916872b7ba380355493f850cf41091b4 100644 (file)
@@ -256,7 +256,7 @@ static int names_pci(struct udev_device *dev, struct netnames *names) {
         if (!parent)
                 return -ENOENT;
         /* check if our direct parent is a PCI device with no other bus in-between */
-        if (streq("pci", udev_device_get_subsystem(parent))) {
+        if (streq_ptr("pci", udev_device_get_subsystem(parent))) {
                 names->type = NET_PCI;
                 names->pcidev = parent;
         } else {