Actions
Bug #9675
closedmemory leak from cpupart_create
Start date:
2018-07-25
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
In usr/src/uts/common/disp/cpupart.c, cpupart_create() allocates a buffer and assigns it to the cp_lgrploads member of a cpupart_t struct:
pp->cp_nlgrploads = lgrp_plat_max_lgrps();
pp->cp_lgrploads = kmem_zalloc(sizeof (lpl_t) * pp->cp_nlgrploads,
KM_SLEEP);
The function then goes on to call cpupart_lpl_initialize(), which allocates an identical buffer and assigns it to the same field, leaking the original buffer:
sz = cp->cp_nlgrploads = lgrp_plat_max_lgrps();
cp->cp_lgrploads = kmem_zalloc(sizeof (lpl_t) * sz, KM_SLEEP);
We should be able to just remove the initial allocation.
Updated by Electric Monk almost 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 2ee857385108d299b716b075df1220fdc893b20b
commit 2ee857385108d299b716b075df1220fdc893b20b Author: John Gallagher <john.gallagher@delphix.com> Date: 2018-09-17T21:29:14.000Z 9675 memory leak from cpupart_create Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Garrett D'Amore <garrett@damore.org>
Actions