get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/808224/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 808224,
    "url": "http://patchwork.ozlabs.org/api/patches/808224/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/lede/patch/1504181291-29592-1-git-send-email-dedeckeh@gmail.com/",
    "project": {
        "id": 54,
        "url": "http://patchwork.ozlabs.org/api/projects/54/?format=api",
        "name": "LEDE development",
        "link_name": "lede",
        "list_id": "lede-dev.lists.infradead.org",
        "list_email": "lede-dev@lists.infradead.org",
        "web_url": "http://lede-project.org/",
        "scm_url": "",
        "webscm_url": "http://git.lede-project.org/",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1504181291-29592-1-git-send-email-dedeckeh@gmail.com>",
    "list_archive_url": null,
    "date": "2017-08-31T12:08:10",
    "name": "[LEDE-DEV,ubox,v3,1/2] kmodloader: lift restriction on module alias info",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ec98ef015f1ffa3f92e7501151650db697807b13",
    "submitter": {
        "id": 65331,
        "url": "http://patchwork.ozlabs.org/api/people/65331/?format=api",
        "name": "Hans Dedecker",
        "email": "dedeckeh@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/lede/patch/1504181291-29592-1-git-send-email-dedeckeh@gmail.com/mbox/",
    "series": [
        {
            "id": 813,
            "url": "http://patchwork.ozlabs.org/api/series/813/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/lede/list/?series=813",
            "date": "2017-08-31T12:08:11",
            "name": "[LEDE-DEV,ubox,v3,1/2] kmodloader: lift restriction on module alias info",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/813/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808224/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808224/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"qn1Le9RW\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"vQN5T32+\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjh4Q5QZwz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 22:09:10 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnOHP-0000y8-Le; Thu, 31 Aug 2017 12:09:03 +0000",
            "from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnOH3-0000NI-ON\n\tfor lede-dev@lists.infradead.org; Thu, 31 Aug 2017 12:08:48 +0000",
            "by mail-wr0-x242.google.com with SMTP id k94so339264wrc.0\n\tfor <lede-dev@lists.infradead.org>;\n\tThu, 31 Aug 2017 05:08:21 -0700 (PDT)",
            "from cplx43.eu.thmulti.com ([141.11.62.7])\n\tby smtp.gmail.com with ESMTPSA id\n\tm78sm3768439wmi.3.2017.08.31.05.08.18\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 31 Aug 2017 05:08:18 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:\n\tDate:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=4JJv/XaNBCzLz7m0fe4+/n1ZvunOwJ2xbv/qziC3vMs=;\n\tb=qn1Le9RWtnEinb\n\tfK8kAQ9c8J0EGKPGfeaho8a3pT1B+np5bfvaueDtRqv3dsQkJTbAoAACmui5wk+F+3WRlak9CvzNR\n\tTEzqx3pKymR9dz/NgqnxRmVq9UhJyT2qXCwe4UDOaTn91pT9GsknU2sZRxZdLw+aVSfQYu9CQa38A\n\tyB1ZsUx/EOA8UXO+3d+b3pXfQ+0dexGOu8hVltZO5ARXMmKQHlBO3KjXd+NBl2QQ56RGN5QK8ugae\n\tTHMZc84qo0geurxzFqmeoMvgO+pHWNTb1F4RNPgqBzotaUwFRguk3o/3P0elh/I7xysNaSgkZmRik\n\tcgdVIt0UguwHie/itXXg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=npE+wVj8VE6vcVwqLcwj7zQdjgNIg90DUccY9Mvmd1A=;\n\tb=vQN5T32+qZrl0icTt++/hS8Zx03U53qUPzRgQBXO0Z7WLjdc+TT8c18zW2e7R/Fd9z\n\tkcDtb6FfJALUbTMcw6G0i87oBcy7vTofXq5QPXnL0x8gt43pHjrgpltb6THx+K5Mk1ED\n\tHgBdOWYNtWgcI1PGUk+zhT3Aj5QWP/QagbvFtbrNPoG8NjYi3lYHv13ut3dhPpC7E0j6\n\tcW8eddLQfj7agMh0q4xXGYToYVEkuO7VJCUxQKyFgoYXCbAGTyysnzTzD0+2IbhLTZ8J\n\tsSw0wHY5hdhImwh4mMJaL4g4vE7wPN0dWcdAcQZrYOOwd59h68zMU7E6jFvIQWgeeWOT\n\tayRw=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=npE+wVj8VE6vcVwqLcwj7zQdjgNIg90DUccY9Mvmd1A=;\n\tb=aOVasAO9xxF9Upwr5HJRwJmOLmwsZ0otXYQhvsRJpHJvOhhTHsNVmJ253KKR+zXZd2\n\t9cGUJPRJtyQ2319Fl5tWDBfaX62gvY8P/YvvHmMdSVjzuaZ0kQPhUWXPsG1RA48odGn/\n\tvtrXMj518RxtFGcOoMq4tdCOgUvRLOiMS5cFMpva1RJBAM9ZVDysZotqTKu0xLBBuChB\n\t1enQgAKTzmxR4bP7evpxKkIBttarYIHIhuKgX58Yjeo5DlwTZtMbjALgjZjoGcugJS/+\n\tlXfpz1KSrw74+tSlSPM37hykY5Ncvm1zntR3JQy5qXJgA9LgAwA1GfiFd4OjmvZp5OyB\n\t1sIA==",
        "X-Gm-Message-State": "AHYfb5itUCmJvF3BpAvF9tayKcmxQe/YygySX5s5l82hVYCpyAgP/i9o\n\tPa4XxoyVrjViOjIC",
        "X-Google-Smtp-Source": "ADKCNb4k8S0+DWTAKzXbUNK63Ku8Hd+O4iJ0W6Veh5rPxcN9GZKpVjsGxa2RQL2LW1V00R5J0tXY2w==",
        "X-Received": "by 10.223.161.9 with SMTP id o9mr3070074wro.284.1504181299406;\n\tThu, 31 Aug 2017 05:08:19 -0700 (PDT)",
        "From": "Hans Dedecker <dedeckeh@gmail.com>",
        "To": "lede-dev@lists.infradead.org,\n\tjohn@phrozen.org,\n\tyszhou4tech@gmail.com",
        "Date": "Thu, 31 Aug 2017 14:08:10 +0200",
        "Message-Id": "<1504181291-29592-1-git-send-email-dedeckeh@gmail.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170831_050842_058381_98A6FE5A ",
        "X-CRM114-Status": "GOOD (  12.69  )",
        "X-Spam-Score": "-2.0 (--)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c0c:0:0:0:242 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (dedeckeh[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain",
        "Subject": "[LEDE-DEV] [PATCH ubox v3 1/2] kmodloader: lift restriction on\n\tmodule alias info",
        "X-BeenThere": "lede-dev@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<lede-dev.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/lede-dev/>",
        "List-Post": "<mailto:lede-dev@lists.infradead.org>",
        "List-Help": "<mailto:lede-dev-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=subscribe>",
        "Cc": "Hans Dedecker <dedeckeh@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"Lede-dev\" <lede-dev-bounces@lists.infradead.org>",
        "Errors-To": "lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "kmodloader has a restriction of storing only 32 aliases for a given\nmodule; as modules can have easily more than 32 aliases let's remove\nthe restriction by using a dynamic allocation mechanism when retrieving\nthe aliases.\nWhile at it also check the get_module_info return value setting an error\ncode in case NULL is returned.\n\nSigned-off-by: Hans Dedecker <dedeckeh@gmail.com>\n---\nv2: Check get_module_info return value setting an error code in\nscan_module_folder in case NULL is returned\nv3: log error in case of OOM\n\n kmodloader.c | 26 ++++++++++++++++----------\n 1 file changed, 16 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/kmodloader.c b/kmodloader.c\nindex 3dc7665..94cfc42 100644\n--- a/kmodloader.c\n+++ b/kmodloader.c\n@@ -340,7 +340,7 @@ static struct module* get_module_info(const char *module, const char *name)\n \tint fd = open(module, O_RDONLY);\n \tunsigned int offset, size;\n \tchar *map = MAP_FAILED, *strings, *dep = NULL;\n-\tconst char *aliases[32] = { 0 };\n+\tconst char **aliases = NULL;\n \tint naliases = 0;\n \tstruct module *m = NULL;\n \tstruct stat s;\n@@ -383,11 +383,13 @@ static struct module* get_module_info(const char *module, const char *name)\n \t\tif (!strncmp(strings, \"depends=\", len + 1))\n \t\t\tdep = sep;\n \t\telse if (!strncmp(strings, \"alias=\", len + 1)) {\n-\t\t\tif (naliases < ARRAY_SIZE(aliases))\n-\t\t\t\taliases[naliases++] = sep;\n-\t\t\telse\n-\t\t\t\tULOG_WARN(\"module %s has more than %d aliases: truncated\",\n-\t\t\t\t\t\tname, ARRAY_SIZE(aliases));\n+\t\t\taliases = realloc(aliases, sizeof(sep) * (naliases + 1));\n+\t\t\tif (!aliases) {\n+\t\t\t\tULOG_ERR(\"out of memory\\n\");\n+\t\t\t\tgoto out;\n+\t\t\t}\n+\n+\t\t\taliases[naliases++] = sep;\n \t\t}\n \t\tstrings = &sep[strlen(sep)];\n \t}\n@@ -404,6 +406,8 @@ out:\n \tif (fd >= 0)\n \t\tclose(fd);\n \n+\tfree(aliases);\n+\n \treturn m;\n }\n \n@@ -413,7 +417,7 @@ static int scan_module_folder(const char *dir)\n \tstruct utsname ver;\n \tchar *path;\n \tglob_t gl;\n-\tint j;\n+\tint j, rv = 0;\n \n \tuname(&ver);\n \tpath = alloca(strlen(dir) + sizeof(\"*.ko\") + 1);\n@@ -430,13 +434,15 @@ static int scan_module_folder(const char *dir)\n \t\t\tcontinue;\n \n \t\tm = find_module(name);\n-\t\tif (!m)\n-\t\t\tget_module_info(gl.gl_pathv[j], name);\n+\t\tif (!m) {\n+\t\t\tif (!get_module_info(gl.gl_pathv[j], name))\n+\t\t\t\trv |= -1;\n+\t\t}\n \t}\n \n \tglobfree(&gl);\n \n-\treturn 0;\n+\treturn rv;\n }\n \n static int scan_module_folders(void)\n",
    "prefixes": [
        "LEDE-DEV",
        "ubox",
        "v3",
        "1/2"
    ]
}