Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/66340/?format=api
https://patches.dpdk.org/api/patches/66340/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200306120047.29392-2-ktraynor@redhat.com/", "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": "<20200306120047.29392-2-ktraynor@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200306120047.29392-2-ktraynor@redhat.com", "date": "2020-03-06T12:00:47", "name": "[2/2] net/hinic: fix repeating log and length check", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8d688b91ba93d30ba3c19c76456b0d8e374d31f6", "submitter": { "id": 598, "url": "https://patches.dpdk.org/api/people/598/?format=api", "name": "Kevin Traynor", "email": "ktraynor@redhat.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200306120047.29392-2-ktraynor@redhat.com/mbox/", "series": [ { "id": 8812, "url": "https://patches.dpdk.org/api/series/8812/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8812", "date": "2020-03-06T12:00:46", "name": "[1/2] net/hinic: fix snprintf length", "version": 1, "mbox": "https://patches.dpdk.org/series/8812/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/66340/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/66340/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AA3A6A056A;\n\tFri, 6 Mar 2020 13:01:19 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7C6161BFE2;\n\tFri, 6 Mar 2020 13:01:12 +0100 (CET)", "from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com\n [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 0ECA31BFDD\n for <dev@dpdk.org>; Fri, 6 Mar 2020 13:01:10 +0100 (CET)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-59-qIM_WUMrPbOD0cLM_WzdjQ-1; Fri, 06 Mar 2020 07:01:07 -0500", "from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com\n [10.5.11.22])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 23D1D18CA240;\n Fri, 6 Mar 2020 12:01:06 +0000 (UTC)", "from rh.redhat.com (unknown [10.33.36.64])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 6F5511001902;\n Fri, 6 Mar 2020 12:01:02 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1583496070;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=J7Igk8iQFm+n64lZujt9FQZgcMft9+hJcvPym4Y9MqU=;\n b=cTcouqz8UnvbPh6/1JCn+RUD0BUW7h5cHlfDF6nr+6jGORbgMuaXLLRAy/RvVD9dhHoJ/8\n AwgAJqrs77N1c56TSn9SUrXfRHOQgFKsj5SdQk8fbybZxfNQfKAVPjKMPpOsGpcJaA8mWV\n p4rZbwckaQ4AhGG80zWBDHqTkKAvuSw=", "X-MC-Unique": "qIM_WUMrPbOD0cLM_WzdjQ-1", "From": "Kevin Traynor <ktraynor@redhat.com>", "To": "dev@dpdk.org", "Cc": "Kevin Traynor <ktraynor@redhat.com>, stable@dpdk.org,\n xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com,\n zhouguoyang@huawei.com", "Date": "Fri, 6 Mar 2020 12:00:47 +0000", "Message-Id": "<20200306120047.29392-2-ktraynor@redhat.com>", "In-Reply-To": "<20200306120047.29392-1-ktraynor@redhat.com>", "References": "<20200306120047.29392-1-ktraynor@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.22", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "quoted-printable", "Subject": "[dpdk-dev] [PATCH 2/2] net/hinic: fix repeating log and length check", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "gcc 10.0.1 reports:\n\n../drivers/net/hinic/base/hinic_pmd_hwdev.c: In function ‘print_cable_info’:\n../drivers/net/hinic/base/hinic_pmd_hwdev.c:1398:3:\nwarning:\n‘snprintf’ argument 4 may overlap destination object ‘tmp_str’\n[-Wrestrict]\n 1398 | snprintf(tmp_str + strlen(tmp_str), (sizeof(tmp_str) - 1),\n | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n 1399 | \"%s, Temperature: %u\", tmp_str,\n | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n 1400 | info->cable_temp);\n | ~~~~~~~~~~~~~~~~~\n\nThe warning is that tmp_str is in both src and dest.\n\nAnyway, the current code is incorrect and because of the +strlen\nthe existing string will be repeated twice and max length\ndoes not limit to the end of the string.\n\nFix by removing tmp_str from the src of snprintf and adding the\ncorrect max length.\n\nFixes: d9ce1917941c (\"net/hinic/base: add hardware operation\")\nCc: stable@dpdk.org\n\nSigned-off-by: Kevin Traynor <ktraynor@redhat.com>\n\n---\nCc: xuanziyang2@huawei.com\nCc: cloud.wangxiaoyun@huawei.com\nCc: zhouguoyang@huawei.com\n---\n drivers/net/hinic/base/hinic_pmd_hwdev.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c\nindex b6c821a2a..fd0292f84 100644\n--- a/drivers/net/hinic/base/hinic_pmd_hwdev.c\n+++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c\n@@ -1396,7 +1396,7 @@ static void print_cable_info(struct hinic_link_info *info)\n \t\t info->cable_length, info->cable_max_speed);\n \tif (info->port_type != LINK_PORT_COPPER)\n-\t\tsnprintf(tmp_str + strlen(tmp_str), (sizeof(tmp_str) - 1),\n-\t\t\t \"%s, Temperature: %u\", tmp_str,\n-\t\t\t info->cable_temp);\n+\t\tsnprintf(tmp_str + strlen(tmp_str),\n+\t\t\t sizeof(tmp_str) - strlen(tmp_str),\n+\t\t\t \", Temperature: %u\", info->cable_temp);\n \n \tPMD_DRV_LOG(INFO, \"Cable information: %s\", tmp_str);\n", "prefixes": [ "2/2" ] }{ "id": 66340, "url": "