Skip to content
Snippets Groups Projects
Commit 101eca15 authored by Vaibhav Gupta's avatar Vaibhav Gupta
Browse files

driver: fmc-eeprom: Fix memory leak


Signed-off-by: default avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent 86ae6b7d
Branches
Tags
No related merge requests found
......@@ -189,12 +189,13 @@ static int __fmc_slot_eeprom_add(struct fmc_slot *slot,
"%s", dev_name(&slot->eeprom->dev));
slot->nvmem = nvmem_device_find(nvmem_parent_name,
fmc_nvmem_device_find_match);
kfree(nvmem_parent_name);
if (IS_ERR_OR_NULL(slot->nvmem)) {
int err = PTR_ERR(slot->nvmem)
slot->nvmem = NULL;
return err;
}
kfree(nvmem_parent_name);
#endif
return 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment