optee: Fix NULL but dereferenced coccicheck error
Subsystems (2)
PATCH 1/1 optee: Fix NULL but dereferenced coccicheck error
Eliminate the following coccicheck warning:
./drivers/tee/optee/smc_abi.c:1508:12-15: ERROR: optee is NULL but dereferenced.
Reported-by Abaci Robot <[email protected]>
Fixes 'commit 6749e69c4dad ("optee: add asynchronous notifications")'
Signed-off-by Yang Li <[email protected]>
--- drivers/tee/optee/smc_abi.c | 2 -- 1 file changed, 2 deletions(-)
drivers/tee/optee/smc_abi.c +0 -2
@@ -1505,8 +1505,6 @@ static int optee_probe(struct platform_device *pdev)kfree (optee); err_free_pool:tee_shm_pool_free (pool); -if (optee->smc.memremaped_shm) -memunmap (optee->smc.memremaped_shm);return rc; }
Signature · 1 line
1.8.3.1
Quoted 17 lines · Yang Li
Eliminate the following coccicheck warning:
./drivers/tee/optee/smc_abi.c:1508:12-15: ERROR: optee is NULL but dereferenced.Reported-by Abaci Robot <[email protected]>Fixes 'commit 6749e69c4dad ("optee: add asynchronous notifications")'Signed-off-by Yang Li <[email protected]>--- drivers/tee/optee/smc_abi.c | 2 -- 1 file changed, 2 deletions(-)drivers/tee/optee/smc_abi.c +0
-0
drivers/tee/optee/smc_abi.c static int optee_probe(struct platform_device *pdev) · line 1509
Quoted 5 lines
drivers/tee/optee/smc_abi.c +0
-2@@ -1505,8 +1505,6 @@ static int optee_probe(struct platform_device *pdev)kfree (optee); err_free_pool:tee_shm_pool_free (pool); -if (optee->smc.memremaped_shm) -memunmap (optee->smc.memremaped_shm);
Thanks for reporting. This should rather be fixed as:
if (memremaped_shm)
memunmap(memremaped_shm);Cheers,
Jens
Quoted 6 lines
drivers/tee/optee/smc_abi.c +0
-1return rc; } --1.8.3.1