summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTharun Kumar Merugu <mtharu@codeaurora.org>2018-10-04 05:12:09 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-09-17 00:10:12 -0700
commita5cdf80ea8fb09cf38cd8d169f87186a91a33206 (patch)
treea420b60a900351bebcc4e5e22dcbed1fecf9a1e8
parent6e94fb15c868d3599ea8cad7f0aa81786b79baaf (diff)
msm: adsprpc: print process kill failure only when subsystem is up
Print error message if process kill on remote subsystem failed. Validate channel ID before dereferencing the channel info struct. When trying to release process on DSP, print failure message only when the subsystem is up, to avoid flooding of kernel logs for daemons. Change-Id: I1b7325d686f6e8699e6f98f529c5dff85cce630d Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com> Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
-rw-r--r--drivers/char/adsprpc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c
index 0e7befd4a146..b898007c63d9 100644
--- a/drivers/char/adsprpc.c
+++ b/drivers/char/adsprpc.c
@@ -652,7 +652,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, unsigned attr,
struct fastrpc_session_ctx *sess;
struct fastrpc_apps *apps = fl->apps;
int cid = fl->cid;
- struct fastrpc_channel_ctx *chan = &apps->channel[cid];
+ struct fastrpc_channel_ctx *chan = NULL;
struct fastrpc_mmap *map = NULL;
struct dma_attrs attrs;
dma_addr_t region_start = 0;
@@ -660,6 +660,11 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, unsigned attr,
unsigned long flags;
int err = 0, vmid;
+ VERIFY(err, cid >= 0 && cid < NUM_CHANNELS);
+ if (err)
+ goto bail;
+ chan = &apps->channel[cid];
+
if (!fastrpc_mmap_find(fl, fd, va, len, mflags, ppmap))
return 0;
map = kzalloc(sizeof(*map), GFP_KERNEL);
@@ -2016,6 +2021,9 @@ static int fastrpc_release_current_dsp_process(struct fastrpc_file *fl)
ioctl.attrs = NULL;
VERIFY(err, 0 == (err = fastrpc_internal_invoke(fl,
FASTRPC_MODE_PARALLEL, 1, &ioctl)));
+ if (err)
+ pr_err("adsprpc: %s: releasing DSP process failed for %s, returned 0x%x",
+ __func__, current->comm, err);
bail:
return err;
}