Merge "msm: adsprpc: Validate smmu device is created before using it"

This commit is contained in:
qctecmdr 2020-03-22 05:55:58 -07:00 • committed by Gerrit - the friendly Code Review server
commit 42372239bf

View file

@ -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 */