OSDN Git Service

drivers: soc: set apr handle to NULL on glink_open error
authorShiv Maliyappanahalli <smaliyap@codeaurora.org>
Fri, 8 Jul 2016 20:00:23 +0000 (13:00 -0700)
committerKyle Yan <kyan@codeaurora.org>
Mon, 11 Jul 2016 21:27:35 +0000 (14:27 -0700)
After sub system restart, opening glink channel while
lpass transport is not up results in failure and returns
error pointer. APR glink client although returns error for
the first glink command, does not set the apr handle to NULL
and incorrectly assumes err pointer as a valid handle when
opening the channel again.

Fix this by updating the apr handle to NULL when glink_open()
fails.

Change-Id: I53a219b1ebed5bc3593d500d80d580aac6431ab5
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
drivers/soc/qcom/qdsp6v2/apr_tal_glink.c

index 14e46b3..7e5f166 100644 (file)
@@ -330,6 +330,7 @@ struct apr_svc_ch_dev *apr_tal_open(uint32_t clnt, uint32_t dest, uint32_t dl,
        if (IS_ERR_OR_NULL(apr_ch->handle)) {
                pr_err("%s: glink_open failed %s\n", __func__,
                       svc_names[dest][clnt]);
+               apr_ch->handle = NULL;
                goto unlock;
        }