diff options
| author | wuchi <[email protected]> | 2022-06-18 08:25:21 +0000 |
|---|---|---|
| committer | akpm <[email protected]> | 2022-07-18 00:31:37 +0000 |
| commit | 5a66fce95b72e6359527415b33a7ae13f0d6b7eb (patch) | |
| tree | 97ce4d8ac30d27286030f33d4a650f54d3223c5f /lib/error-inject.c | |
| parent | init: add "hostname" kernel parameter (diff) | |
| download | kernel-5a66fce95b72e6359527415b33a7ae13f0d6b7eb.tar.gz kernel-5a66fce95b72e6359527415b33a7ae13f0d6b7eb.zip | |
lib/lru_cache: fix error free handing in lc_create
When kmem_cache_alloc in function lc_create returns null, we will
free the memory already allocated. The loop of kmem_cache_free
is wrong, especially:
i = 0 ==> do wrong loop
i > 0 ==> do not free element[0]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: wuchi <[email protected]>
Cc: Philipp Reisner <[email protected]>
Cc: Lars Ellenberg <[email protected]>
Cc: Christoph Bhmwalder <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/error-inject.c')
0 files changed, 0 insertions, 0 deletions
