Skip to content
Snippets Groups Projects
Commit 86ae6b7d authored by Federico Vaga's avatar Federico Vaga Committed by Vaibhav Gupta
Browse files

drivers: fmc-eeprom: Reset the pointer on error.


On error, set the slot->nvmem to NULL. This keeps the data structure in
line with the real status (the nvmem device was not found).

Reported by: Federico Vaga <federico.vaga@cern.ch>
Signed-off-by: default avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent 80f92d43
Branches
Tags
No related merge requests found
......@@ -189,8 +189,11 @@ 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);
if (IS_ERR_OR_NULL(slot->nvmem))
return PTR_ERR(slot->nvmem);
if (IS_ERR_OR_NULL(slot->nvmem)) {
int err = PTR_ERR(slot->nvmem)
slot->nvmem = NULL;
return err;
}
kfree(nvmem_parent_name);
#endif
......
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