Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 256f38b7 authored by Patrick Daly's avatar Patrick Daly Committed by Swathi Sridhar
Browse files

driver_core: Avoid NULL dereference when CONFIG_OF_KOBJ=n



Avoid creating a symlink to a nonexistent kobject.

Change-Id: I6468d8f5d6e585d84826762ba6c34ded71b030cd
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent c80d9b60
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1658,7 +1658,7 @@ static int device_add_class_symlinks(struct device *dev)
	struct device_node *of_node = dev_of_node(dev);
	int error;

	if (of_node) {
	if (of_node && of_node_kobj(of_node)) {
		error = sysfs_create_link(&dev->kobj, of_node_kobj(of_node), "of_node");
		if (error)
			dev_warn(dev, "Error %d creating of_node link\n",error);