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

Commit cc578218 authored by Govindaraj Rajagopal's avatar Govindaraj Rajagopal Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Added error handling in clock data structure



Added Conditional check to ensure presence of clock data,
Close the session if it does not exist

Change-Id: I16f06d89c9a8195242fc3715aa13ac12ebcd99c1
Signed-off-by: default avatarGovindaraj Rajagopal <grajagop@codeaurora.org>
parent af372cc5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1021,6 +1021,12 @@ int msm_comm_init_clocks_and_bus_data(struct msm_vidc_inst *inst)
			break;
		}
	}

	if (!inst->clk_data.entry) {
		dprintk(VIDC_ERR, "%s No match found\n", __func__);
		rc = -EINVAL;
	}

	return rc;
}

+5 −1
Original line number Diff line number Diff line
@@ -3259,7 +3259,11 @@ static int msm_comm_session_init(int flipped_state,
		return -EINVAL;
	}

	msm_comm_init_clocks_and_bus_data(inst);
	rc = msm_comm_init_clocks_and_bus_data(inst);
	if (rc) {
		dprintk(VIDC_ERR, "Failed to initialize clocks and bus data\n");
		goto exit;
	}

	dprintk(VIDC_DBG, "%s: inst %pK\n", __func__, inst);
	rc = call_hfi_op(hdev, session_init, hdev->hfi_device_data,