On 08/05/2020 11:19, Suganath Prabu S wrote: > - kfree(ioc->hpr_lookup); > - kfree(ioc->internal_lookup); > + if (ioc->hpr_lookup) { > + kfree(ioc->hpr_lookup); > + ioc->hpr_lookup = NULL; > + } > + if (ioc->internal_lookup) { > + kfree(ioc->internal_lookup); > + ioc->internal_lookup = NULL; > + } The check before kfree() isn't needed, you could simplify this to: kfree(ioc->hpr_lookup); ioc->hpr_lookup = NULL; kfree(ioc->internal_lookup); ioc->internal_lookup = NULL;