Merge "msm: camera: common: Fix NULL pointer dereference" into camera-kernel.lnx.5.0
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
625981cd2e
@@ -111,6 +111,11 @@ int cam_irq_controller_deinit(void **irq_controller)
|
|||||||
struct cam_irq_controller *controller = *irq_controller;
|
struct cam_irq_controller *controller = *irq_controller;
|
||||||
struct cam_irq_evt_handler *evt_handler = NULL;
|
struct cam_irq_evt_handler *evt_handler = NULL;
|
||||||
|
|
||||||
|
if (!controller) {
|
||||||
|
CAM_ERR(CAM_IRQ_CTRL, "Null Pointer");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
while (!list_empty(&controller->evt_handler_list_head)) {
|
while (!list_empty(&controller->evt_handler_list_head)) {
|
||||||
evt_handler = list_first_entry(
|
evt_handler = list_first_entry(
|
||||||
&controller->evt_handler_list_head,
|
&controller->evt_handler_list_head,
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cam_req_mgr_debug.h"
|
#include "cam_req_mgr_debug.h"
|
||||||
@@ -147,6 +147,7 @@ end:
|
|||||||
int cam_req_mgr_debug_unregister(void)
|
int cam_req_mgr_debug_unregister(void)
|
||||||
{
|
{
|
||||||
debugfs_remove_recursive(debugfs_root);
|
debugfs_remove_recursive(debugfs_root);
|
||||||
|
debugfs_root = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cam_cci_dev.h"
|
#include "cam_cci_dev.h"
|
||||||
@@ -548,6 +548,7 @@ static void cam_cci_component_unbind(struct device *dev,
|
|||||||
|
|
||||||
cam_cpas_unregister_client(cci_dev->cpas_handle);
|
cam_cpas_unregister_client(cci_dev->cpas_handle);
|
||||||
debugfs_remove_recursive(debugfs_root);
|
debugfs_remove_recursive(debugfs_root);
|
||||||
|
debugfs_root = NULL;
|
||||||
cam_cci_soc_remove(pdev, cci_dev);
|
cam_cci_soc_remove(pdev, cci_dev);
|
||||||
rc = cam_unregister_subdev(&(cci_dev->v4l2_dev_str));
|
rc = cam_unregister_subdev(&(cci_dev->v4l2_dev_str));
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -932,7 +932,8 @@ static void cam_res_mgr_component_unbind(struct device *dev,
|
|||||||
{
|
{
|
||||||
if (cam_res) {
|
if (cam_res) {
|
||||||
cam_res_mgr_free_res();
|
cam_res_mgr_free_res();
|
||||||
devm_pinctrl_put(cam_res->pinctrl);
|
if (cam_res->pinctrl)
|
||||||
|
devm_pinctrl_put(cam_res->pinctrl);
|
||||||
cam_res->pinctrl = NULL;
|
cam_res->pinctrl = NULL;
|
||||||
cam_res->pstatus = PINCTRL_STATUS_PUT;
|
cam_res->pstatus = PINCTRL_STATUS_PUT;
|
||||||
kfree(cam_res);
|
kfree(cam_res);
|
||||||
|
Reference in New Issue
Block a user