!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:
openeuler-ci-bot
2025-09-22 12:09:27 +00:00
committed by Gitee
2 changed files with 11 additions and 4 deletions
+5 -2
View File
@@ -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;
+6 -2
View File
@@ -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);