Skip to content
Commit dfdf1414 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Greg Kroah-Hartman
Browse files

nvmem: core: fix error path in nvmem_add_cells()



The current code fails to nvmem_cell_drop(cells[0]) - even worse, if
the loop above fails already at i==0, we'll enter an essentially
infinite loop doing nvmem_cell_drop on cells[-1], cells[-2], ... which
is unlikely to end well.

Also, we're not freeing the temporary backing array cells on the error
path.

Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 990162f0
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