mirror of
https://gitee.com/openeuler/kernel
synced 2026-09-08 23:59:09 +08:00
!18085 Fix CVE-2022-50343
Merge Pull Request from: @ci-robot PR sync from: Hongbo Li <lihongbo22@huawei.com> https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/WCRMEKEEWRRUC2THAMOGTCCVD67WAIES/ Fix CVE-2022-50343. Yang Yingliang (1): rapidio: fix possible name leaks when rio_add_device() fails https://gitee.com/src-openeuler/kernel/issues/ICYBX8 Link:https://gitee.com/openeuler/kernel/pulls/18085 Reviewed-by: Yuan Can <yuancan@huawei.com> Signed-off-by: Yuan Can <yuancan@huawei.com>
This commit is contained in:
@@ -1800,8 +1800,11 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
|
||||
rio_init_dbell_res(&rdev->riores[RIO_DOORBELL_RESOURCE],
|
||||
0, 0xffff);
|
||||
err = rio_add_device(rdev);
|
||||
if (err)
|
||||
goto cleanup;
|
||||
if (err) {
|
||||
put_device(&rdev->dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
rio_dev_get(rdev);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -460,8 +460,12 @@ static struct rio_dev *rio_setup_device(struct rio_net *net,
|
||||
0, 0xffff);
|
||||
|
||||
ret = rio_add_device(rdev);
|
||||
if (ret)
|
||||
goto cleanup;
|
||||
if (ret) {
|
||||
if (rswitch)
|
||||
kfree(rswitch->route_table);
|
||||
put_device(&rdev->dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rio_dev_get(rdev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user