misc: fastrpc: fix error code in fastrpc_req_mmap()
authorDan Carpenter <error27@gmail.com>
Tue, 29 Nov 2022 09:45:16 +0000 (12:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jan 2023 12:22:11 +0000 (13:22 +0100)
The "err" variable shadows an earlier global variable so this code
returns success instead of a negative error code.

Fixes: 532ad70c6d44 ("misc: fastrpc: Add mmap request assigning for static PD pool")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y4XUrMETCl1O6t0A@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/fastrpc.c

index c9902a1dcf5d311043182ee87f4dbc5ec6085cae..876f0f146b16e70816d909252313435ae97d58af 100644 (file)
@@ -1894,7 +1894,6 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
        /* Add memory to static PD pool, protection thru hypervisor */
        if (req.flags != ADSP_MMAP_REMOTE_HEAP_ADDR && fl->cctx->vmcount) {
                struct qcom_scm_vmperm perm;
-               int err = 0;
 
                perm.vmid = QCOM_SCM_VMID_HLOS;
                perm.perm = QCOM_SCM_PERM_RWX;