Merge "msm: eva: Fix UAF issue when remove module"

This commit is contained in:
QCTECMDR Service 2024-07-21 23:56:22 -07:00 • committed by Gerrit - the friendly Code Review server
commit c2a6a9ca1a

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/debugfs.h>
@ -491,7 +492,11 @@ static int msm_cvp_remove(struct platform_device *pdev)
return -EINVAL;
}
core = dev_get_drvdata(&pdev->dev);
if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-cvp"))
core = dev_get_drvdata(&pdev->dev);
else
core = dev_get_drvdata(pdev->dev.parent);
if (!core) {
dprintk(CVP_ERR, "%s invalid core", __func__);
return -EINVAL;