ipmi: remve duplicate code in __ipmi_bmc_register()
authorJing Xiangfeng <jingxiangfeng@huawei.com>
Mon, 20 Jul 2020 08:08:38 +0000 (16:08 +0800)
committerCorey Minyard <cminyard@mvista.com>
Mon, 20 Jul 2020 11:31:50 +0000 (06:31 -0500)
__ipmi_bmc_register() jumps to the label 'out_free_my_dev_name' in an
error path. So we can remove duplicate code in the if (rv).

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Message-Id: <20200720080838.148737-1-jingxiangfeng@huawei.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_msghandler.c

index e1b22fe0916cf8c85ab8172e62f53c1bf9307d01..737c0b6b24ea6a84f74fa90eb6a0ff7603ad8899 100644 (file)
@@ -3080,8 +3080,6 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf,
        rv = sysfs_create_link(&bmc->pdev.dev.kobj, &intf->si_dev->kobj,
                               intf->my_dev_name);
        if (rv) {
-               kfree(intf->my_dev_name);
-               intf->my_dev_name = NULL;
                dev_err(intf->si_dev, "Unable to create symlink to bmc: %d\n",
                        rv);
                goto out_free_my_dev_name;