Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/56531/?format=api
https://patches.dpdk.org/api/patches/56531/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190716172741.21399-4-stephen@networkplumber.org/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20190716172741.21399-4-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190716172741.21399-4-stephen@networkplumber.org", "date": "2019-07-16T17:27:41", "name": "[3/3] cfgfile: use calloc", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9eacc039f692c37e334d8eb8040fb89970931f33", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190716172741.21399-4-stephen@networkplumber.org/mbox/", "series": [ { "id": 5538, "url": "https://patches.dpdk.org/api/series/5538/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5538", "date": "2019-07-16T17:27:38", "name": "cfgfile: cleanup patches", "version": 1, "mbox": "https://patches.dpdk.org/series/5538/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/56531/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/56531/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B8BB71B9C9;\n\tTue, 16 Jul 2019 19:28:00 +0200 (CEST)", "from mail-pg1-f196.google.com (mail-pg1-f196.google.com\n\t[209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 7821B4CE4\n\tfor <dev@dpdk.org>; Tue, 16 Jul 2019 19:27:54 +0200 (CEST)", "by mail-pg1-f196.google.com with SMTP id s1so3464957pgr.2\n\tfor <dev@dpdk.org>; Tue, 16 Jul 2019 10:27:54 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tm6sm21173049pfb.151.2019.07.16.10.27.52\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tTue, 16 Jul 2019 10:27:52 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=vRrqhYoOD+XwrMbiwT57dAa2bgdFnmDc6NXKuyewnRk=;\n\tb=YcBQjOerHdFSZHmbUzN41G/OD4r+u2xLFf/e60MMnADkkbrklnZpwsxFUFVgnArpaZ\n\tIptips+lxVHZ+BnEOTMnbGjgOpkNImd3Ht0hfiAmZixG2YaqHTZnHWdwso30sDuZpM2L\n\t0EwyTCRFxFEhE9FaP6kBCDLCxxUmYfby7f4Kp0YBsBnFWIWYH1xB2Uveg0qvrF7ZA3pU\n\tt+fEfp1MDdd5SskPQg4IE2LXCP6Q+ax4T55CvcF0f9ilQWXW5yZgjqbS0zunVd7LZmGc\n\tdYU7NMhUWyOZJDBmtF2M+hOpaFhD9Qg03Pq9wKzROeuYpaosfIeYFAQQIi8zunBp6Ijz\n\tExrA==", "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:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=vRrqhYoOD+XwrMbiwT57dAa2bgdFnmDc6NXKuyewnRk=;\n\tb=M7DVwtF17+Hy3hJs9WyPrSduyxc9CazMQI2jTZB+uOCm+wERQ3sLzPn6/2kEDBKTg6\n\tGQZC2EcGP+PBXQZLepUEtA99AnpZlhCzF7CblwGtTtcm/vhca8bEgzi5DQuMjMKea0rs\n\t8lYVvzge0pwfe/7bu6/2efE+QrXtvJ508614UFV9KAv9ykmPKXBnc/m9ZWyEmRFRNUTU\n\ti+7I1ViX0/6c7uvxmP9DnhgZazY3HdPpm+6hqDJlWj5OnnfuPWWg8+UIvCY2UEHgqnt1\n\tyLH4VZbIhOiTM0xif+ZVATEu2oE3bH4ibSZ3kuKv77JCWUev5oAa59yOsQSzRxFMKSE5\n\tg5kQ==", "X-Gm-Message-State": "APjAAAUImALSWG4U2E7qnXxfr8ugd94FL9E0MSn99ViuOYxMm192WG4z\n\tOE+lk9PIU0keCJDNuUV0m/s=", "X-Google-Smtp-Source": "APXvYqzz2blvcVStUFfiFCgMrKA912OQ9T8vAmz289fW44gm0dY39//ONhhDr+IooEiRhIlfPygCQA==", "X-Received": "by 2002:a17:90a:346c:: with SMTP id\n\to99mr37460729pjb.20.1563298073654; \n\tTue, 16 Jul 2019 10:27:53 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "cristian.dumitrescu@intel.com", "Cc": "dev@dpdk.org,\n\tStephen Hemminger <stephen@networkplumber.org>", "Date": "Tue, 16 Jul 2019 10:27:41 -0700", "Message-Id": "<20190716172741.21399-4-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190716172741.21399-1-stephen@networkplumber.org>", "References": "<20190716172741.21399-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 3/3] cfgfile: use calloc", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Better to use calloc when allocating arrays.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/librte_cfgfile/rte_cfgfile.c | 9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c\nindex c4b768b6833f..39fec4b82bce 100644\n--- a/lib/librte_cfgfile/rte_cfgfile.c\n+++ b/lib/librte_cfgfile/rte_cfgfile.c\n@@ -275,17 +275,16 @@ rte_cfgfile_create(int flags)\n \tcfg->num_sections = 0;\n \n \t/* allocate first batch of sections and entries */\n-\tcfg->sections = malloc(sizeof(struct rte_cfgfile_section) *\n-\t\t\tCFG_ALLOC_SECTION_BATCH);\n-\n+\tcfg->sections = calloc(CFG_ALLOC_SECTION_BATCH,\n+\t\t\t sizeof(struct rte_cfgfile_section));\n \tif (cfg->sections == NULL)\n \t\tgoto error1;\n \n \tcfg->allocated_sections = CFG_ALLOC_SECTION_BATCH;\n \n \tfor (i = 0; i < CFG_ALLOC_SECTION_BATCH; i++) {\n-\t\tcfg->sections[i].entries = malloc(sizeof(\n-\t\t\tstruct rte_cfgfile_entry) * CFG_ALLOC_ENTRY_BATCH);\n+\t\tcfg->sections[i].entries = calloc(CFG_ALLOC_ENTRY_BATCH,\n+\t\t\t\t\t sizeof(struct rte_cfgfile_entry));\n \n \t\tif (cfg->sections[i].entries == NULL)\n \t\t\tgoto error1;\n", "prefixes": [ "3/3" ] }{ "id": 56531, "url": "