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: Santosh Mardi <gsantosh@codeaurora.org>
This commit is contained in:
Santosh Mardi 2020-10-08 13:08:48 +05:30
commit c8c8485942

View file

@ -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");