RE: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays.

From: Ratheesh Kannoth
Date: Tue Jan 23 2024 - 22:02:54 EST


> From: Simon Horman <horms@xxxxxxxxxx>
> Subject: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays.
>
> Hi Ratheesh,
>
> I assume that the reason that the cited commit moved away from devm_
> allocations was to allow more natural management of the resources
> independently of the life cycle of the driver instance. Or in other words, the
> need to free the bitmaps in npc_mcam_rsrcs_deinit() probably indicates that
> devm_ allocations of them aren't giving us anything.
>
> So, perhaps kcalloc() is more appropriate than devm_kcalloc() ?
This was a comment from @Subbaraya Sundeep Bhatta during our internal review.
Could you please help with below questions/doubts ?
1. why devm_kfree() API is available if it is done independently
2. I could see instances of devm_kfree() usage in current kernel where it does explicit calls.

-Ratheesh