Whamcloud - gitweb
LU-16890 obd: OBD_FREE_PRE() to ignore NULL pointers
This patch modifies OBD_FREE_PRE() to not LASSERT
when null pointer is passed as the kfree() function
accepts NULL as no-op.
This is first set of patch that modifies the definitions.
Subsequent set will modify the callers to accept this
case.
As as example:
This caller will now be change to:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char *test;
OBD_ALLOC(test, 32);
...
OBD_FREE(test, 32);
Previously the caller used to be:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char *test;
OBD_ALLOC(test, 32);
...
if (test)
OBD_FREE(test, 32);
Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I735c8210e30f58da19ede4c87c07186108b35b99
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51332
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>