Skip to content
Snippets Groups Projects
Commit 8b989e69 authored by Deepali Jindal's avatar Deepali Jindal Committed by Gerrit - the friendly Code Review server
Browse files

ipc : gpr-lite: Add NULL check for gpr dev pointer

it is possible that gpr may get deregistered already and
hence will not get any pointer for gpr from dev_get_drvdata
so proceed further only if gpr exists otherwise,
it will lead to crash issue.

Change-Id: I4129a76d1deade0c243c9a9515a8f84542f3596c
parent 6f7d21f7
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,12 @@ int gpr_send_pkt(struct gpr_device *adev, struct gpr_pkt *pkt)
gpr = dev_get_drvdata(adev->dev.parent);
if (!gpr) {
pr_err_ratelimited("%s: Failed to get gpr dev pointer : gpr[%pK] \n",
__func__, gpr);
return -EINVAL;
}
if ((adev->domain_id == GPR_DOMAIN_ADSP) &&
(gpr_get_q6_state() != GPR_SUBSYS_LOADED)) {
dev_err_ratelimited(gpr->dev,"%s: domain_id[%d], Still Dsp is not Up\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment