[PATCH v2 3/4] mtd: core: fix error path for nvmem provider