mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
Merge "msm: camera: tfe: Fix dereference of pointer before NULL check" into camera-kernel.lnx.4.0
This commit is contained in:
commit
774b550caf
2 changed files with 13 additions and 8 deletions
|
|
@ -6098,7 +6098,7 @@ static int cam_isp_context_dump_requests(void *data,
|
|||
static int cam_isp_context_handle_message(void *context,
|
||||
uint32_t msg_type, uint32_t *data)
|
||||
{
|
||||
int rc = 0;
|
||||
int rc = -EINVAL;
|
||||
struct cam_hw_cmd_args hw_cmd_args;
|
||||
struct cam_isp_hw_cmd_args isp_hw_cmd_args;
|
||||
struct cam_context *ctx = (struct cam_context *)context;
|
||||
|
|
|
|||
|
|
@ -319,9 +319,10 @@ static int cam_tfe_hw_mgr_get_clock_rate(
|
|||
continue;
|
||||
|
||||
hw_intf = isp_hw_res->hw_res[i]->hw_intf;
|
||||
CAM_DBG(CAM_ISP, "hw type %d hw index:%d",
|
||||
hw_intf->hw_type, hw_intf->hw_idx);
|
||||
if (hw_intf && hw_intf->hw_ops.process_cmd) {
|
||||
CAM_DBG(CAM_ISP, "hw type %d hw index:%d",
|
||||
hw_intf->hw_type, hw_intf->hw_idx);
|
||||
|
||||
rc = hw_intf->hw_ops.process_cmd(
|
||||
hw_intf->hw_priv,
|
||||
CAM_ISP_HW_CMD_GET_CLOCK_RATE,
|
||||
|
|
@ -343,7 +344,7 @@ static int cam_tfe_hw_mgr_update_clock_rate(
|
|||
uint32_t *updated_clock_rate)
|
||||
{
|
||||
int i;
|
||||
int rc = 0;
|
||||
int rc = -EINVAL;
|
||||
struct cam_hw_intf *hw_intf;
|
||||
|
||||
for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
|
||||
|
|
@ -351,29 +352,33 @@ static int cam_tfe_hw_mgr_update_clock_rate(
|
|||
continue;
|
||||
|
||||
hw_intf = isp_hw_res->hw_res[i]->hw_intf;
|
||||
CAM_DBG(CAM_ISP, "hw type %d hw index:%d",
|
||||
hw_intf->hw_type, hw_intf->hw_idx);
|
||||
|
||||
if (hw_intf && hw_intf->hw_ops.process_cmd) {
|
||||
CAM_DBG(CAM_ISP, "hw type %d hw index:%d",
|
||||
hw_intf->hw_type, hw_intf->hw_idx);
|
||||
|
||||
rc = hw_intf->hw_ops.process_cmd(
|
||||
hw_intf->hw_priv,
|
||||
CAM_ISP_HW_CMD_DYNAMIC_CLOCK_UPDATE,
|
||||
set_clock_rate,
|
||||
sizeof(uint32_t));
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_ISP, "Failed to get Clock rate");
|
||||
CAM_ERR(CAM_ISP, "Failed to set Clock rate");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
if (hw_intf && hw_intf->hw_ops.process_cmd) {
|
||||
CAM_DBG(CAM_ISP, "hw type %d hw index:%d",
|
||||
hw_intf->hw_type, hw_intf->hw_idx);
|
||||
|
||||
rc = hw_intf->hw_ops.process_cmd(
|
||||
hw_intf->hw_priv,
|
||||
CAM_ISP_HW_CMD_GET_CLOCK_RATE,
|
||||
updated_clock_rate,
|
||||
sizeof(uint32_t));
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_ISP, "Failed to get Clock rate");
|
||||
CAM_ERR(CAM_ISP, "Failed to get updated clock rate");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue