msm: camera: common: Avoid uninitialized accesses
Improve the error-handling code paths to prevent accesses to uninitialized variables. This is done by either picking a sane default for the variable or skipping accesses altogether after an unsuccessful attempt to initialize. CRs-Fixed: 2748220 Change-Id: Ibe383e56ec4e3f45f76f619c7d6b62c3d7dfcadb Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
This commit is contained in:
@@ -637,6 +637,7 @@ static int __cam_custom_ctx_release_hw_in_top_state(
|
||||
flush_req.type = CAM_REQ_MGR_FLUSH_TYPE_ALL;
|
||||
flush_req.link_hdl = ctx->link_hdl;
|
||||
flush_req.dev_hdl = ctx->dev_hdl;
|
||||
flush_req.req_id = 0;
|
||||
|
||||
CAM_DBG(CAM_CUSTOM, "try to flush pending list");
|
||||
spin_lock_bh(&ctx->lock);
|
||||
@@ -694,6 +695,7 @@ static int __cam_custom_release_dev_in_acquired(struct cam_context *ctx,
|
||||
flush_req.type = CAM_REQ_MGR_FLUSH_TYPE_ALL;
|
||||
flush_req.link_hdl = ctx->link_hdl;
|
||||
flush_req.dev_hdl = ctx->dev_hdl;
|
||||
flush_req.req_id = 0;
|
||||
|
||||
CAM_DBG(CAM_CUSTOM, "try to flush pending list");
|
||||
spin_lock_bh(&ctx->lock);
|
||||
|
Reference in New Issue
Block a user