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

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

Merge "qcom: ssr: Nullify subsys pointer in restart group if registration fails"

parents c0bc614b 01fee9e0
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -1400,6 +1400,7 @@ static void subsys_free_irqs(struct subsys_device *subsys)
struct subsys_device *subsys_register(struct subsys_desc *desc)
struct subsys_device *subsys_register(struct subsys_desc *desc)
{
{
	struct subsys_device *subsys;
	struct subsys_device *subsys;
	struct device_node *ofnode = desc->dev->of_node;
	int ret;
	int ret;


	subsys = kzalloc(sizeof(*subsys), GFP_KERNEL);
	subsys = kzalloc(sizeof(*subsys), GFP_KERNEL);
@@ -1447,7 +1448,7 @@ struct subsys_device *subsys_register(struct subsys_desc *desc)
		goto err_register;
		goto err_register;
	}
	}


	if (desc->dev->of_node) {
	if (ofnode) {
		ret = subsys_parse_devicetree(desc);
		ret = subsys_parse_devicetree(desc);
		if (ret)
		if (ret)
			goto err_register;
			goto err_register;
@@ -1456,16 +1457,14 @@ struct subsys_device *subsys_register(struct subsys_desc *desc)


		ret = subsys_setup_irqs(subsys);
		ret = subsys_setup_irqs(subsys);
		if (ret < 0)
		if (ret < 0)
			goto err_register;
			goto err_setup_irqs;


		if (of_property_read_u32(desc->dev->of_node,
		if (of_property_read_u32(ofnode, "qcom,ssctl-instance-id",
					"qcom,ssctl-instance-id",
					&desc->ssctl_instance_id))
					&desc->ssctl_instance_id))
			pr_debug("Reading instance-id for %s failed\n",
			pr_debug("Reading instance-id for %s failed\n",
								desc->name);
								desc->name);


		if (of_property_read_u32(desc->dev->of_node,
		if (of_property_read_u32(ofnode, "qcom,sysmon-id",
					"qcom,sysmon-id",
					&subsys->desc->sysmon_pid))
					&subsys->desc->sysmon_pid))
			pr_debug("Reading sysmon-id for %s failed\n",
			pr_debug("Reading sysmon-id for %s failed\n",
								desc->name);
								desc->name);
@@ -1477,7 +1476,9 @@ struct subsys_device *subsys_register(struct subsys_desc *desc)
	mutex_unlock(&subsys_list_lock);
	mutex_unlock(&subsys_list_lock);


	return subsys;
	return subsys;

err_setup_irqs:
	if (ofnode)
		subsys_remove_restart_order(ofnode);
err_register:
err_register:
	subsys_debugfs_remove(subsys);
	subsys_debugfs_remove(subsys);
err_debugfs:
err_debugfs: