crypto/caam_jr: fix check before job ring freeing
authorGagandeep Singh <g.singh@nxp.com>
Mon, 29 Oct 2018 12:15:51 +0000 (12:15 +0000)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 2 Nov 2018 11:26:06 +0000 (12:26 +0100)
Check should be on parameter uio_fd instead of
local variable job_ring

Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/caam_jr/caam_jr_uio.c

index c07d9db..d94101c 100644 (file)
@@ -332,7 +332,7 @@ free_job_ring(uint32_t uio_fd)
        struct uio_job_ring *job_ring = NULL;
        int i;
 
-       if (!job_ring->uio_fd)
+       if (!uio_fd)
                return;
 
        for (i = 0; i < MAX_SEC_JOB_RINGS; i++) {