Loading drivers/soc/qcom/smem.c +7 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, Sony Mobile Communications AB. * Copyright (c) 2012-2013, 2017, 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2013, 2017, 2019-2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1053,6 +1053,12 @@ static int qcom_smem_probe(struct platform_device *pdev) static int qcom_smem_remove(struct platform_device *pdev) { hwspin_lock_free(__smem->hwlock); /* In case of Hibernation Restore __smem object is still valid * and we call probe again so same object get allocated again * that result into possible memory leak, hence explicitly freeing * it here. */ devm_kfree(&pdev->dev, __smem); __smem = NULL; return 0; Loading Loading
drivers/soc/qcom/smem.c +7 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, Sony Mobile Communications AB. * Copyright (c) 2012-2013, 2017, 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2013, 2017, 2019-2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1053,6 +1053,12 @@ static int qcom_smem_probe(struct platform_device *pdev) static int qcom_smem_remove(struct platform_device *pdev) { hwspin_lock_free(__smem->hwlock); /* In case of Hibernation Restore __smem object is still valid * and we call probe again so same object get allocated again * that result into possible memory leak, hence explicitly freeing * it here. */ devm_kfree(&pdev->dev, __smem); __smem = NULL; return 0; Loading