--- zzzz-none-000/linux-3.10.107/drivers/hwmon/ultra45_env.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/hwmon/ultra45_env.c 2021-02-04 17:41:59.000000000 +0000 @@ -252,7 +252,7 @@ static int env_probe(struct platform_device *op) { - struct env *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct env *p = devm_kzalloc(&op->dev, sizeof(*p), GFP_KERNEL); int err = -ENOMEM; if (!p) @@ -262,7 +262,7 @@ p->regs = of_ioremap(&op->resource[0], 0, REG_SIZE, "pic16f747"); if (!p->regs) - goto out_free; + goto out; err = sysfs_create_group(&op->dev.kobj, &env_group); if (err) @@ -286,8 +286,6 @@ out_iounmap: of_iounmap(&op->resource[0], p->regs, REG_SIZE); -out_free: - kfree(p); goto out; } @@ -299,7 +297,6 @@ sysfs_remove_group(&op->dev.kobj, &env_group); hwmon_device_unregister(p->hwmon_dev); of_iounmap(&op->resource[0], p->regs, REG_SIZE); - kfree(p); } return 0; @@ -317,7 +314,6 @@ static struct platform_driver env_driver = { .driver = { .name = "ultra45_env", - .owner = THIS_MODULE, .of_match_table = env_match, }, .probe = env_probe,