mem-buf: Exit mem_buf_lend_internal if the mem-buf not probed

Exit with an error from mem_buf_lend_internal() if the driver hasn't
probed.

Change-Id: Ide42166c2f850197f989a228f9139d401411a914
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
This commit is contained in:
Chris Goldsworthy 2022-10-11 20:30:08 -07:00
parent 3a0a1539ac
commit f484c0e648

View File

@ -452,6 +452,11 @@ static int mem_buf_lend_internal(struct dma_buf *dmabuf,
if (!arg->nr_acl_entries || !arg->vmids || !arg->perms)
return -EINVAL;
if (!mem_buf_dev) {
pr_err("%s: mem-buf driver not probed!\n", __func__);
return -ENODEV;
}
vmperm = to_mem_buf_vmperm(dmabuf);
if (IS_ERR(vmperm)) {
pr_err_ratelimited("dmabuf ops %ps are not a mem_buf_dma_buf_ops\n",