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

Commit 7ec281fe authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "driver core: fix race between creating/querying glue dir and its cleanup"

parents 444ca975 eaecc204
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -785,6 +785,7 @@ static struct kobject *get_device_parent(struct device *dev,
		return &parent->kobj;
	return NULL;
}

static inline bool live_in_glue_dir(struct kobject *kobj,
				    struct device *dev)
{
@@ -796,10 +797,9 @@ static inline bool live_in_glue_dir(struct kobject *kobj,

static inline struct kobject *get_glue_dir(struct device *dev)
{
	if (live_in_glue_dir(&dev->kobj, dev))
	return dev->kobj.parent;
	return NULL;
}

/*
 * make sure cleaning up dir as the last step, we need to make
 * sure .release handler of kobject is run with holding the
@@ -978,8 +978,8 @@ int device_add(struct device *dev)
	struct device *parent = NULL;
	struct kobject *kobj;
	struct class_interface *class_intf;
	struct kobject *glue_dir = NULL;
	int error = -EINVAL;
	struct kobject *glue_dir = NULL;

	dev = get_device(dev);
	if (!dev)