From patchwork Mon May 6 19:23:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Christensen X-Patchwork-Id: 53296 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5170937A2; Mon, 6 May 2019 21:23:50 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id C8F032082 for ; Mon, 6 May 2019 21:23:48 +0200 (CEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x46JN8Ia025061 for ; Mon, 6 May 2019 15:23:47 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sau1n810w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 May 2019 15:23:47 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 May 2019 20:23:46 +0100 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 6 May 2019 20:23:45 +0100 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x46JNi9T43057422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2019 19:23:44 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D43DAE05F; Mon, 6 May 2019 19:23:44 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA212AE05C; Mon, 6 May 2019 19:23:43 +0000 (GMT) Received: from oprom9.localdomain (unknown [9.40.204.34]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 6 May 2019 19:23:43 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: David Christensen Date: Mon, 6 May 2019 14:23:40 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 19050619-0040-0000-0000-000004EC05AD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011061; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01199531; UDB=6.00629314; IPR=6.00980407; MB=3.00026760; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-06 19:23:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050619-0041-0000-0000-000008F80DC5 Message-Id: <1557170620-99694-1-git-send-email-drc@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-06_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=715 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905060160 Subject: [dpdk-dev] [PATCH v2 2/4] test: verify calloc succeeded for sum variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Code tested calloc failures for pt & lpt variables but not for the sum variable. Add a test for calloc failure of sum. Signed-off-by: David Christensen Acked-by: Konstantin Ananyev --- v2: * Removed change to ITER_MAX app/test/test_barrier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c index c219d56..ae37b1e 100644 --- a/app/test/test_barrier.c +++ b/app/test/test_barrier.c @@ -202,7 +202,7 @@ struct lcore_plock_test { printf("%s(iter=%u, utype=%u) started on %u lcores\n", __func__, iter, utype, n); - if (pt == NULL || lpt == NULL) { + if (pt == NULL || lpt == NULL || sum == NULL) { printf("%s: failed to allocate memory for %u lcores\n", __func__, n); free(pt);