From: Nathan Lynch Subject: [PATCH 01/11] checkpoint: fix leak in VMA restore error path Date: Wed, 20 Oct 2010 13:56:36 -0500 Message-ID: <1287601006-13794-2-git-send-email-ntl@pobox.com> References: <1287601006-13794-1-git-send-email-ntl@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1287601006-13794-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org If the vma record contains unsupported flags restore_vma() returns -ENOSYS without releasing the record. Signed-off-by: Nathan Lynch --- mm/checkpoint.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mm/checkpoint.c b/mm/checkpoint.c index 70300e8..00cbadd 100644 --- a/mm/checkpoint.c +++ b/mm/checkpoint.c @@ -1209,8 +1209,9 @@ static int restore_vma(struct ckpt_ctx *ctx, struct mm_struct *mm) goto out; if (h->vma_type >= CKPT_VMA_MAX) goto out; + ret = -ENOSYS; if (h->vm_flags & CKPT_VMA_NOT_SUPPORTED) - return -ENOSYS; + goto out; ops = &restore_vma_ops[h->vma_type]; -- 1.7.2.2