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

Commit c8c84859 authored by Santosh Mardi's avatar Santosh Mardi
Browse files

drivers: soc: qcom: avoid double initialization of kobj



In rimps_memlat driver the rimps_kobj is initialized twice
once while creating and another while initializing and adding
to the parent kobj, which resulted in kernel warning.

Fix the double initialization of rimps_kobj.

Change-Id: I95c03d83f63cffd506b2f3ee36f1a6da9f4f1d31
Signed-off-by: default avatarSantosh Mardi <gsantosh@codeaurora.org>
parent 5702001d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1255,10 +1255,13 @@ static int memlat_cpu_grp_probe(struct platform_device *pdev)
	}

	if (!rimps_kobj) {
		rimps_kobj = kobject_create();
		if (!rimps_kobj)
		rimps_kobj = kzalloc(sizeof(*rimps_kobj), GFP_KERNEL);

		if (!rimps_kobj) {
			dev_err(dev, "%s: failed to create rimps_kobj\n",
						__func__);
			return -ENOMEM;
		}

		ret = kobject_init_and_add(rimps_kobj, &ktype_log_level,
				   &cpu_subsys.dev_root->kobj, "memlat");