From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA398A034C; Sat, 26 Feb 2022 15:55:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BD2D4068F; Sat, 26 Feb 2022 15:55:40 +0100 (CET) Received: from out162-62-58-216.mail.qq.com (out162-62-58-216.mail.qq.com [162.62.58.216]) by mails.dpdk.org (Postfix) with ESMTP id DC10440395 for ; Sat, 26 Feb 2022 15:55:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1645887336; bh=XjtCq8oP8HsnIws/EHJStwT9D4BIYYJfBYW+XQbwKjQ=; h=From:To:Cc:Subject:Date; b=d+RL2cbQqAVntcvtJF9Q57FniAW8Z1IEfvbJRjm+RJnSWyIwK72jEBrePy8uZeDgV rRHmHL1TW5YqqWQlTK6//cqIssEKNOSxp24KPQU5X4nbDGog1oB2AU+9+jkD5zZH3C hEb0JtrlN15YF+Vp8oeaZ/FqhmlskjVEv57bE5vY= Received: from localhost.localdomain ([111.193.130.237]) by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP id DDEBAC62; Sat, 26 Feb 2022 22:55:30 +0800 X-QQ-mid: xmsmtpt1645887330t6fgljzgq Message-ID: X-QQ-XMAILINFO: NFlkxqDaIerInQZgUvZKOPJv6t5PrZc2kSeXRt9kxD+/apgphkKr1BxtWjKMph I1TPC/fb3mEoVEFBDqe03T/XyYZLdV7ucAwictXM7tGQzCGxtDkNWRzor+GyRotQUekkBJ7tg3Sc hzbxK+XfY8cXy2pS/8PKb94OVzRd/p/7/JBYQ8NnjgjfmeziioTOSrhLIXw+D3MxC86fEOW+INvR OFauyuTx9qUsyIJTbsFecWKShpqjZ7YyEZ0Lgldr/zr6Cfud+mqxp2o51nBfOXD0utQr3SUp/bQp 55CY67xdJhrt0nztQLr14xNuPTjWimdGX24ovadqQoiQ7jmkak5gtt42nQBo1NCb/LJJIJpJcSbi fyH33o42EF4KMS0+qU/BdnHSRg/f0S755lIylXjTDlwLeFq2R7p5uViB23h1fniaZMkyKr5s0pP+ 6Cx9cwYLXXCaGUJ3FDvgZoJDSb86w6DB6Dc5wIR34ls90sL7WGAa2j7pFZ7j9ys+n7BelTutyDUy ilzi7a0wUxoclM+SYazn/PxTYy0gyAf5ZXXIRch1H5oTZXI1eupvhU2bWeyQxKHvYNq8R/bCCSmS Vv52OoeCq79HLixTAkZWbLl8adfhoBAQFcjd9dor1wvKZj2PGn7mppnCPyrCHR7eqnKaVP5qVftQ tloIPLzlbE4WE8wqz1MC7K+cyum6PxSYq/Z2CufvPtS9Z30sLDY/aUOf6dtwDLZdwicfj69q4NsZ pPVTn0aauE7xvax1nrQUdIGvzJ1a0cOr8ZeOQf1BB/VWI/ycVhCeH6C4o3vt/tRNYqkGPUHuN7fW bUaMmqrfNX/GQF5gEHzw1Nms44Rjg0Bj2ktLvjxsIYygIOQW5ffXNKw9DeUaLnJ1DBWYEpQq8cN0 f5OdZnsop8Aom7eigQDIMgzAkK7IXgvXX8WysT41C8OZH5RgImVTE= From: Weiguo Li To: cristian.dumitrescu@intel.com Cc: wojciechx.liguzinski@intel.com, dev@dpdk.org Subject: [PATCH] sched: add parentheses to if clause Date: Sat, 26 Feb 2022 22:55:30 +0800 X-OQ-MSGID: <20220226145530.356828-1-liwg06@foxmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add parentheses to 'if' clause, otherwise will enlarged the chance of error return. Fixes: 44c730b0e37971 ("sched: add PIE based congestion management") Signed-off-by: Weiguo Li --- lib/sched/rte_pie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sched/rte_pie.c b/lib/sched/rte_pie.c index cdb7bab697..51df403a25 100644 --- a/lib/sched/rte_pie.c +++ b/lib/sched/rte_pie.c @@ -18,10 +18,10 @@ rte_pie_rt_data_init(struct rte_pie *pie) /* Allocate memory to use the PIE data structure */ pie = rte_malloc(NULL, sizeof(struct rte_pie), 0); - if (pie == NULL) + if (pie == NULL) { RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__); - - return -1; + return -1; + } } pie->active = 0; -- 2.25.1