Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7c61a5e authored by VijayaKumar T M's avatar VijayaKumar T M
Browse files

msm: camera: Fix uninitialized and Null pointer dereference



- Initialize uninitialized variabled.
- Check for Null pointer dereference.

Change-Id: I27714561a1e53db6bfba431ba155d2044e87b8da
Signed-off-by: default avatarVijayaKumar T M <vtmuni@codeaurora.org>
parent f1adb3b2
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -876,6 +876,8 @@ static int __cam_isp_ctx_reg_upd_in_epoch_state(
	else if (ctx_isp->fps && ((rup_event_data->irq_mono_boot_time -
		ctx_isp->irq_timestamps) > ((1000*1000)/ctx_isp->fps))) {
		ctx_isp->irq_delay_detect = true;

		if (req)
			trace_cam_isp_irq_delay_detect("IRQ delay at reg_upd",
				ctx, req->request_id,
				ctx_isp->substate_activated,
@@ -1196,7 +1198,7 @@ static int __cam_isp_ctx_reg_upd_in_sof(struct cam_isp_context *ctx_isp,
static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
	void *evt_data)
{
	struct cam_ctx_request    *req;
	struct cam_ctx_request    *req = NULL;
	struct cam_isp_ctx_req    *req_isp = NULL;
	struct cam_context        *ctx = ctx_isp->base;
	uint64_t  request_id = 0;
@@ -2308,7 +2310,7 @@ static int __cam_isp_ctx_dump_in_top_state(struct cam_context *ctx,
	struct timeval cur_time;
	int rc = 0;
	uintptr_t cpu_addr;
	size_t buf_len;
	size_t buf_len = 0;
	struct cam_isp_context_dump_header *hdr;
	uint64_t *addr, *start;
	uint8_t *dst;
@@ -2486,6 +2488,7 @@ static int __cam_isp_ctx_flush_req_in_top_state(
	struct cam_hw_stop_args           stop_args;
	struct cam_isp_start_args         start_isp;
	struct cam_hw_reset_args          reset_args;

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		CAM_INFO(CAM_ISP, "ctx id:%d Last request id to flush is %lld",
			ctx->ctx_id, flush_req->req_id);
+9 −7
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, 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
@@ -273,13 +273,15 @@ static int cam_lrme_hw_dev_remove(struct platform_device *pdev)
	kfree(lrme_core);

deinit_platform_res:
	if (lrme_hw) {
		rc = cam_lrme_soc_deinit_resources(&lrme_hw->soc_info);
		if (rc)
		CAM_ERR(CAM_LRME, "Error in LRME soc deinit, rc=%d", rc);
			CAM_ERR(CAM_LRME,
				"Error in LRME soc deinit, rc=%d", rc);

		mutex_destroy(&lrme_hw->hw_mutex);
		kfree(lrme_hw);

	}
	return rc;
}