Some not-so-well-designed Android apps try to recursively read
the sysfs nodes, e.g., cpu information. The subsystem/ node
sometimes is a symlink back to itself, and this causes these
apps to run out of memory iterating all the nodes.
This patch skips the creation of the subsystem nodes if it is
building for Android devices. There should not be any ill-effects
as Android userspace does not look at the subsystem nodes.
Issue: AXIA-629
Change-Id: I748c8b2fde85161e55b006319d46e8e6bbe4eb43
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
&dev->kobj, dev_name(dev));
if (error)
goto out_id;
+#ifndef CONFIG_ANDROID
error = sysfs_create_link(&dev->kobj,
&dev->bus->p->subsys.kobj, "subsystem");
if (error)
goto out_subsys;
+#endif
klist_add_tail(&dev->p->knode_bus, &bus->p->klist_devices);
}
return 0;
if (!dev->class)
return 0;
+#ifndef CONFIG_ANDROID
error = sysfs_create_link(&dev->kobj,
&dev->class->p->subsys.kobj,
"subsystem");
if (error)
goto out;
+#endif
if (dev->parent && device_is_not_partition(dev)) {
error = sysfs_create_link(&dev->kobj, &dev->parent->kobj,