2021-12-26 14:32:51

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH] optee: Use bitmap_free() to free bitmap

kfree() and bitmap_free() are the same. But using the latter is more
consistent when freeing memory allocated with bitmap_zalloc().

Signed-off-by: Christophe JAILLET <[email protected]>
---
drivers/tee/optee/notif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tee/optee/notif.c b/drivers/tee/optee/notif.c
index a28fa03dcd0e..05212842b0a5 100644
--- a/drivers/tee/optee/notif.c
+++ b/drivers/tee/optee/notif.c
@@ -121,5 +121,5 @@ int optee_notif_init(struct optee *optee, u_int max_key)

void optee_notif_uninit(struct optee *optee)
{
- kfree(optee->notif.bitmap);
+ bitmap_free(optee->notif.bitmap);
}
--
2.32.0



2021-12-27 05:36:36

by Sumit Garg

[permalink] [raw]
Subject: Re: [PATCH] optee: Use bitmap_free() to free bitmap

On Sun, 26 Dec 2021 at 20:02, Christophe JAILLET
<[email protected]> wrote:
>
> kfree() and bitmap_free() are the same. But using the latter is more
> consistent when freeing memory allocated with bitmap_zalloc().
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> drivers/tee/optee/notif.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Looks reasonable to me.

Reviewed-by: Sumit Garg <[email protected]>

-Sumit

> diff --git a/drivers/tee/optee/notif.c b/drivers/tee/optee/notif.c
> index a28fa03dcd0e..05212842b0a5 100644
> --- a/drivers/tee/optee/notif.c
> +++ b/drivers/tee/optee/notif.c
> @@ -121,5 +121,5 @@ int optee_notif_init(struct optee *optee, u_int max_key)
>
> void optee_notif_uninit(struct optee *optee)
> {
> - kfree(optee->notif.bitmap);
> + bitmap_free(optee->notif.bitmap);
> }
> --
> 2.32.0
>

2022-01-14 10:01:33

by Jens Wiklander

[permalink] [raw]
Subject: Re: [PATCH] optee: Use bitmap_free() to free bitmap

On Mon, Dec 27, 2021 at 6:36 AM Sumit Garg <[email protected]> wrote:
>
> On Sun, 26 Dec 2021 at 20:02, Christophe JAILLET
> <[email protected]> wrote:
> >
> > kfree() and bitmap_free() are the same. But using the latter is more
> > consistent when freeing memory allocated with bitmap_zalloc().
> >
> > Signed-off-by: Christophe JAILLET <[email protected]>
> > ---
> > drivers/tee/optee/notif.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> Looks reasonable to me.
>
> Reviewed-by: Sumit Garg <[email protected]>
>

Looks good, picking up this.

Thanks,
Jens