[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHUa44EPVSQSMr78om6SXG3B+UEQ-J6qUnLJs_ZqswTAbTv2+Q@mail.gmail.com>
Date: Fri, 19 Nov 2021 13:04:28 +0100
From: Jens Wiklander <jens.wiklander@...aro.org>
To: Yang Li <yang.lee@...ux.alibaba.com>
Cc: sumit.garg@...aro.org, op-tee@...ts.trustedfirmware.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] optee: Fix NULL but dereferenced coccicheck error
On Fri, Nov 19, 2021 at 9:05 AM Yang Li <yang.lee@...ux.alibaba.com> wrote:
>
> Eliminate the following coccicheck warning:
> ./drivers/tee/optee/smc_abi.c:1508:12-15: ERROR: optee is NULL but
> dereferenced.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Fixes: 'commit 6749e69c4dad ("optee: add asynchronous notifications")'
> Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
> ---
> drivers/tee/optee/smc_abi.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
> index 92759d7..1f471ff 100644
> --- a/drivers/tee/optee/smc_abi.c
> +++ b/drivers/tee/optee/smc_abi.c
> @@ -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
> return rc;
> }
>
> --
> 1.8.3.1
>
Powered by blists - more mailing lists