mirror of https://github.com/torvalds/linux.git
The function has a memory leak when kvrealloc() fails. The function directly assigns NULL to the markers pointer, losing the reference to the previously allocated memory. This causes kvfree() in pt_dump_init() to free NULL instead of the leaked memory. Fix by: 1. Using kvrealloc() uniformly for all allocations 2. Using a temporary variable to preserve the original pointer until allocation succeeds 3. Removing the error path that sets markers_cnt=0 to keep consistency between markers and markers_cnt Found via static analysis and this is similar to commit |
||
|---|---|---|
| .. | ||
| Makefile | ||
| cmm.c | ||
| dump_pagetables.c | ||
| extable.c | ||
| extmem.c | ||
| fault.c | ||
| gmap.c | ||
| gmap_helpers.c | ||
| hugetlbpage.c | ||
| init.c | ||
| maccess.c | ||
| mmap.c | ||
| page-states.c | ||
| pageattr.c | ||
| pfault.c | ||
| pgalloc.c | ||
| pgtable.c | ||
| physaddr.c | ||
| vmem.c | ||