Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/524091/?format=api
{ "id": 524091, "url": "http://patchwork.ozlabs.org/api/patches/524091/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1443578287-7847-2-git-send-email-andrew.donnellan@au1.ibm.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<1443578287-7847-2-git-send-email-andrew.donnellan@au1.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1443578287-7847-2-git-send-email-andrew.donnellan@au1.ibm.com/", "date": "2015-09-30T01:58:06", "name": "[2/3] cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "f9c75b6fca557dfda6b6c3f7333aff12be6e3674", "submitter": { "id": 66955, "url": "http://patchwork.ozlabs.org/api/people/66955/?format=api", "name": "Andrew Donnellan", "email": "andrew.donnellan@au1.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1443578287-7847-2-git-send-email-andrew.donnellan@au1.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/524091/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/524091/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3C376140778\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Sep 2015 12:01:32 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 0A4E01A1999\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Sep 2015 12:01:32 +1000 (AEST)", "from ozlabs.org (ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id BA7BD1A05D7\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 30 Sep 2015 11:59:05 +1000 (AEST)", "by ozlabs.org (Postfix)\n\tid 872F1140D16; Wed, 30 Sep 2015 11:59:05 +1000 (AEST)", "from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140])\n\t(using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 69E44140778\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 30 Sep 2015 11:59:05 +1000 (AEST)", "from /spool/local\n\tby e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@ozlabs.org> from <andrew.donnellan@au1.ibm.com>;\n\tWed, 30 Sep 2015 11:59:04 +1000", "from d23dlp02.au.ibm.com (202.81.31.213)\n\tby e23smtp07.au.ibm.com (202.81.31.204) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 30 Sep 2015 11:59:02 +1000", "from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219])\n\tby d23dlp02.au.ibm.com (Postfix) with ESMTP id 85F802BB0051\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 30 Sep 2015 11:59:01 +1000 (EST)", "from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])\n\tby d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tt8U1wnMw41025772\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 30 Sep 2015 11:58:57 +1000", "from d23av01.au.ibm.com (localhost [127.0.0.1])\n\tby d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tt8U1wSwS032120\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 30 Sep 2015 11:58:29 +1000", "from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tt8U1wSTZ031602; Wed, 30 Sep 2015 11:58:28 +1000", "from ajd.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\tby ozlabs.au.ibm.com (Postfix) with ESMTP id 18DE7A0129;\n\tWed, 30 Sep 2015 11:58:04 +1000 (AEST)" ], "X-Helo": "d23dlp02.au.ibm.com", "X-MailFrom": "andrew.donnellan@au1.ibm.com", "X-RcptTo": "linuxppc-dev@ozlabs.org", "From": "Andrew Donnellan <andrew.donnellan@au1.ibm.com>", "To": "linuxppc-dev@ozlabs.org", "Subject": "[PATCH 2/3] cxl: fix leak of ctx->irq_bitmap when releasing context\n\tvia kernel API", "Date": "Wed, 30 Sep 2015 11:58:06 +1000", "Message-Id": "<1443578287-7847-2-git-send-email-andrew.donnellan@au1.ibm.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1443578287-7847-1-git-send-email-andrew.donnellan@au1.ibm.com>", "References": "<1443578287-7847-1-git-send-email-andrew.donnellan@au1.ibm.com>", "X-TM-AS-MML": "disable", "X-Content-Scanned": "Fidelis XPS MAILER", "x-cbid": "15093001-0025-0000-0000-00000236F71F", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.20", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "mikey@neuling.org, mrochs@linux.vnet.ibm.com, imunsie@au1.ibm.com,\n\tvaibhav@linux.vnet.ibm.com", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "At present, ctx->irq_bitmap is freed in afu_release_irqs(), which is called\nfrom afu_release() via cxl_context_detach().\n\nMove the freeing of ctx->irq_bitmap from afu_release_irqs() to\nreclaim_ctx() (called through cxl_context_free()) so it's freed when\nreleasing a context via the kernel API (cxl_release_context()) or the\nuserspace API (afu_release()).\n\nReported-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>\nFixes: 6f7f0b3df6d4 (\"cxl: Add AFU virtual PHB and kernel API\")\nSigned-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>\n---\n drivers/misc/cxl/context.c | 3 +++\n drivers/misc/cxl/irq.c | 2 --\n 2 files changed, 3 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c\nindex e762f85..2faa127 100644\n--- a/drivers/misc/cxl/context.c\n+++ b/drivers/misc/cxl/context.c\n@@ -275,6 +275,9 @@ static void reclaim_ctx(struct rcu_head *rcu)\n \tif (ctx->kernelapi)\n \t\tkfree(ctx->mapping);\n \n+\tif (ctx->irq_bitmap)\n+\t\tkfree(ctx->irq_bitmap);\n+\n \tkfree(ctx);\n }\n \ndiff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c\nindex 38b57d6..09a4060 100644\n--- a/drivers/misc/cxl/irq.c\n+++ b/drivers/misc/cxl/irq.c\n@@ -524,7 +524,5 @@ void afu_release_irqs(struct cxl_context *ctx, void *cookie)\n \tafu_irq_name_free(ctx);\n \tcxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter);\n \n-\tkfree(ctx->irq_bitmap);\n-\tctx->irq_bitmap = NULL;\n \tctx->irq_count = 0;\n }\n", "prefixes": [ "2/3" ] }