UBI: fix error path in __wl_get_peb
In case of an error (if there are not free PEB's for example), __wl_get_peb will return a negative value. In order to prevent access violation we need to test the returned value prior to using it later on. Signed-off-by: NTatyana Brokhman <tlinder@codeaurora.org> Reviewed-by: NDolev Raviv <draviv@codeaurora.org> Acked-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Showing
想要评论请 注册 或 登录