mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-06 13:55:08 +08:00
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 <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220220151527.17216-14-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bcf4ef28b0
commit
4c49300d8e
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user