diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2020-01-30 22:13:51 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-01-31 10:30:38 -0800 |
commit | 3e21d9a501bf99aee2e5835d7f34d8c823f115b5 (patch) | |
tree | 65c17c1de27674a327f31687e42922109ec51f3a /mm/early_ioremap.c | |
parent | 7e168b9babab254c3f9a6c7ed100faee73d493f8 (diff) | |
download | lwn-3e21d9a501bf99aee2e5835d7f34d8c823f115b5.tar.gz lwn-3e21d9a501bf99aee2e5835d7f34d8c823f115b5.zip |
lib/test_kasan.c: fix memory leak in kmalloc_oob_krealloc_more()
In case memory resources for _ptr2_ were allocated, release them before
return.
Notice that in case _ptr1_ happens to be NULL, krealloc() behaves
exactly like kmalloc().
Addresses-Coverity-ID: 1490594 ("Resource leak")
Link: http://lkml.kernel.org/r/20200123160115.GA4202@embeddedor
Fixes: 3f15801cdc23 ("lib: add kasan test module")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/early_ioremap.c')
0 files changed, 0 insertions, 0 deletions