Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nvmem: core: initialise nvmem->id early
The error path for wp_gpio attempts to free the IDA nvmem->id, but this has yet to be assigned, so will always be zero - leaking the ID allocated by ida_alloc(). Fix this by moving the initialisation of nvmem->id earlier. Fixes: f7d8d7d ("nvmem: fix memory leak in error path") Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
- Loading branch information