From: Andy Shevchenko Date: Sun, 20 Feb 2022 15:15:27 +0000 (+0000) Subject: thunderbolt: Drop duplicate NULL checks around nvmem_unregister() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4c49300d8e676702cc097784007bf11735821d6d;p=linux.git thunderbolt: Drop duplicate NULL checks around nvmem_unregister() Since nvmem_unregister() checks for NULL, no need to repeat in the caller. Drop duplicate NULL checks. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220220151527.17216-14-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c index 3a5336913ccac..b3f3103893786 100644 --- a/drivers/thunderbolt/nvm.c +++ b/drivers/thunderbolt/nvm.c @@ -154,10 +154,8 @@ int tb_nvm_add_non_active(struct tb_nvm *nvm, size_t size, void tb_nvm_free(struct tb_nvm *nvm) { if (nvm) { - if (nvm->non_active) - nvmem_unregister(nvm->non_active); - if (nvm->active) - nvmem_unregister(nvm->active); + nvmem_unregister(nvm->non_active); + nvmem_unregister(nvm->active); vfree(nvm->buf); ida_simple_remove(&nvm_ida, nvm->id); }