Message ID | CAMcxFTQu5eFSQ1v55aWtfm8Pi6Z+Ai+m8cz2PZrNr_42qMyo_Q@mail.gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <patch+caf_=linaro-patchwork=canonical.com@linaro.org> X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B3F5A23DEA for <patchwork@peony.canonical.com>; Sat, 9 Feb 2013 18:05:19 +0000 (UTC) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by fiordland.canonical.com (Postfix) with ESMTP id E39DCA193BC for <linaro-patchwork@canonical.com>; Sat, 9 Feb 2013 18:05:18 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id pb11so4173745veb.5 for <linaro-patchwork@canonical.com>; Sat, 09 Feb 2013 10:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:dkim-signature:mime-version:x-received:date:message-id :from:to:subject:x-beenthere:x-mailman-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:sender:errors-to :x-gm-message-state; bh=KSd3AXPxMeTNDSfL4upd74yHJHGuGM/3rr3ixQ0JOFM=; b=PTOQc8dJ19TRWtQ0NeDi9nWSD7G/fVnvTXI2ryOOEO12jGwvlrmbKI5MABZnb7a3rc 5DcEutcg+h4RF1UmFrmumsdf8eAkXvGSbRdRPUjpSwLIOVirYcf0kAd8CG2L3P9C350A c3Ft4yRMpGwu5U2+h9Ufg8XeJzEAkxl4zPDrgW1mD6YcwaXJMNNGXfcqA7XnxUHnrHAm KJcFCeFueHavajJLagoVioxB3euvyrIJVIDI3345mFHpNJjEQALDSiQM4010cJSi6ssj q91I18zo6Re6iZ2KDcGwrHcUgnB+XT6MgubemmNWEunD+qb9xsV8zy8i+05/q+KgxQ2N 6Vqg== X-Received: by 10.220.151.141 with SMTP id c13mr12127369vcw.64.1360433118285; Sat, 09 Feb 2013 10:05:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp21083vec; Sat, 9 Feb 2013 10:05:17 -0800 (PST) X-Received: by 10.205.136.205 with SMTP id il13mr1095734bkc.93.1360433116417; Sat, 09 Feb 2013 10:05:16 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id iq2si22701305bkc.46.2013.02.09.10.05.09; Sat, 09 Feb 2013 10:05:16 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from <linaro-mm-sig-bounces@lists.linaro.org>) id 1U4EnP-000729-GS; Sat, 09 Feb 2013 18:05:03 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from <nishanth.p@gmail.com>) id 1U4EnN-000724-Uf for linaro-mm-sig@lists.linaro.org; Sat, 09 Feb 2013 18:05:02 +0000 Received: by mail-lb0-f174.google.com with SMTP id l12so3680915lbo.5 for <linaro-mm-sig@lists.linaro.org>; Sat, 09 Feb 2013 10:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=ccUWJutlrDI3m4iTJHHV5RXvdOlFtFoBPxgdMz+l8fo=; b=0V/2yeqiVnKNoZHhjMHuXwLCygD0EsOrmdkGCvloDquec29Lf5bxFU/GEtZS8ZFm/q yC3dQ2LLyhpu38xNRXYKgZ9J3GbWY/8JMGEzv0rXbZjbCPXDHLj8cDVkU8d1MgRR+Kai pFMz+8meOF+x5mHG8p76tfJG/ow4hl4fu9anaV5+Mf3CJHGj/suqOVSnVqXxJx0HrPHY 56SweI2ks72+bOIiiqHLxOsvkWkBLi6r3ApmDo4OfJAfMKBsQ7Ti0/GxU9n2NJqxXExe E7bIk44QIZ8epx/0yq+uvFQjDpGhuX6Jbpa2xggFhz/8tpg4+6OGjG0OwWkLkxW7vsBi V4eg== MIME-Version: 1.0 X-Received: by 10.112.43.198 with SMTP id y6mr3781775lbl.93.1360433101347; Sat, 09 Feb 2013 10:05:01 -0800 (PST) Received: by 10.112.104.72 with HTTP; Sat, 9 Feb 2013 10:05:01 -0800 (PST) Date: Sat, 9 Feb 2013 23:35:01 +0530 Message-ID: <CAMcxFTQu5eFSQ1v55aWtfm8Pi6Z+Ai+m8cz2PZrNr_42qMyo_Q@mail.gmail.com> From: Nishanth Peethambaran <nishanth.p@gmail.com> To: linaro-mm-sig@lists.linaro.org, Rebecca Schultz Zavin <rebecca@android.com> Subject: [Linaro-mm-sig] [PATCH] gpu: ion: Use safe version of list iterator X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." <linaro-mm-sig.lists.linaro.org> List-Unsubscribe: <http://lists.linaro.org/mailman/options/linaro-mm-sig>, <mailto:linaro-mm-sig-request@lists.linaro.org?subject=unsubscribe> List-Archive: <http://lists.linaro.org/pipermail/linaro-mm-sig> List-Post: <mailto:linaro-mm-sig@lists.linaro.org> List-Help: <mailto:linaro-mm-sig-request@lists.linaro.org?subject=help> List-Subscribe: <http://lists.linaro.org/mailman/listinfo/linaro-mm-sig>, <mailto:linaro-mm-sig-request@lists.linaro.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQnGqvoA0uSdgOkrPHEzw5kexaLoj8avMqBExO0ya0PsvdRK5keI+xHhceDb0R7PxTjbjNut |
diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c index c1061a8..d079e2b 100644 --- a/drivers/gpu/ion/ion_system_heap.c +++ b/drivers/gpu/ion/ion_system_heap.c @@ -200,7 +200,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap, err1: kfree(table); err: - list_for_each_entry(info, &pages, list) { + list_for_each_entry_safe(info, tmp_info, &pages, list) { free_buffer_page(sys_heap, buffer, info->page, info->order); kfree(info); }
On allocation or kmalloc failure in system heap allocate, the exit path iterates over the allocated page infos and frees the allocated pages and page info. The same page info structure is used as loop iterator. Use the safe version of list iterator. Signed-off-by: Nishanth Peethambaran <nishanth@broadcom.com> --- drivers/gpu/ion/ion_system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)