diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 32c5c302cbae..550f4c208174 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -1136,9 +1136,11 @@ static int fastrpc_buf_alloc(struct fastrpc_file *fl, size_t size, struct fastrpc_buf *buf = NULL, *fr = NULL; struct hlist_node *n; - VERIFY(err, size > 0); - if (err) + VERIFY(err, size > 0 && fl->sctx->smmu.dev); + if (err) { + err = (fl->sctx->smmu.dev == NULL) ? -ENODEV : err; goto bail; + } if (!remote) { /* find the smallest buffer that fits in the cache */