diff options
author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-05-16 06:49:25 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-16 06:49:25 -0700 |
commit | 3715a9458a427ffd8289d01f7be155f65002ff98 (patch) | |
tree | bbc3ec5272f3c3e6480357f282b2d2e874a561b0 /drivers | |
parent | 560c77a760bd7e9e39e566aa350ab891566f88c4 (diff) | |
parent | 94e69df40141a3611650332576c0b9138866bd00 (diff) |
Merge "msm: ADSPRPC: verify and initialize some variables"
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/adsprpc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index b1432ccf5358..38da42906994 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -1488,14 +1488,15 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode, int err = 0; struct timespec invoket; + if (fl->profile) + getnstimeofday(&invoket); + VERIFY(err, fl->sctx); if (err) goto bail; VERIFY(err, fl->cid >= 0 && fl->cid < NUM_CHANNELS); if (err) goto bail; - if (fl->profile) - getnstimeofday(&invoket); if (!kernel) { VERIFY(err, 0 == context_restore_interrupted(fl, inv, &ctx)); @@ -2440,6 +2441,9 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) if (err) goto bail; cid = fl->cid; + VERIFY(err, cid >= 0 && cid < NUM_CHANNELS); + if (err) + goto bail; if (me->channel[cid].ssrcount != me->channel[cid].prevssrcount) { if (!me->channel[cid].issubsystemup) { @@ -2448,9 +2452,6 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) goto bail; } } - VERIFY(err, cid >= 0 && cid < NUM_CHANNELS); - if (err) - goto bail; fl->ssrcount = me->channel[cid].ssrcount; if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) || (me->channel[cid].chan == 0)) { |