On 09/14/2016 04:39 PM, Marion & Christophe JAILLET wrote:
I don't share your feeling.
bitmap_create() can return ERR_PTR(-ENOMEM) or ERR_PTR(-EINVAL).
In such cases 'if (!bitmap)' will not be helpful.
Maybe it should be turned into 'if (IS_ERR_OR_NULL(bitmap))' to handle
errors returned by bitmap_create.
Maybe just removing the call to 'bitmap_free(bitmap)' is enough.
I agreed we can remove it, if so, seems we are not consistent with the
previous comment of bitmap_create.
* initialize the bitmap structure
* if this returns an error, bitmap_destroy must be called to do clean up
What about revert it and re-use v1 patch? see