[PATCH v2 1/7] nvmem: fix memory leak in error path