From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F8BFA057B for ; Mon, 6 Apr 2020 13:31:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2ABC21BEE7; Mon, 6 Apr 2020 13:31:10 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id B8F042B96 for ; Mon, 6 Apr 2020 13:31:06 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id g27so14191321ljn.10 for ; Mon, 06 Apr 2020 04:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=P/TmNd2PKxTlJPxBQifWC6DVz7bEe9Xfg6AOnaNQCdg=; b=layCt+0sjJ5uK+1GvfOKnILj4wcBZcCxlPjxAORmI3zcxIbV69PbuyrNt6/U/k/KvY VYicsextuzw38j/7oLnjtQz3sWsQHmFZQ7CBqzowsgg8jh8TkJQSuRYh4ED3RsP5WKFk aM+WlFcwZ6Fgx9S1HT9WQj/knHFNdHiwgFvgkENwvB6TCRjGtwPA4iBe321wJz6OciXn uVg6qZ8LnL2lKkTukUgzrZLmHv5Ug+BCPHwmQncwX3trRueaD19zM/ZuXY6JFkQBW8gB iE0+jmrXZ3qENnxlth6foZXKAi9tqizCqwlsO6RumB4DjnF/Nwnu1p8HytYF4XXu4mW1 NdCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P/TmNd2PKxTlJPxBQifWC6DVz7bEe9Xfg6AOnaNQCdg=; b=ddLMBmMBfVjdKITBnC+dzrg7nWgOp5Qn0+ZCwxXXmxd+r7/xfkLd3LyJyjdke97hLy 322WSkh+2rQ1llPDaPqVrd/u/peRYuz3OiWjN/keAMWrGEwPneOGFxnFqEHAStgsJ0n7 zsEqTwsz/Ip3R8nULKVheV/UiOmjHe+5Gugc3G5HwKo1Z2bh4C88tl53Cb6xIDYhSjWc amMQYel1RO18rlB1IvMWueqWo6fY/7NOKPmMlm6QTgmD2NZv4Or55Zd7rod3s8ptwvAI ShwdLNcNMUowVyo9BCt7pHw7+PqctjCiyp9Icj46l28wFHEL93KjGQlPQjLT1migm9rl GG/A== X-Gm-Message-State: AGi0PuYl1Vpy7pim8okmtYpKwVqwjPIG7u1yEQhQ7psMBtDfFf6iLy2P m5pBdowcTR9VjjGfpBruQIyrmQ== X-Google-Smtp-Source: APiQypLudicRf2JgIu9VMYL6VwJeipzoh1RA7JPTdzuwxisBApIaIFWpZ5skA0k7LT2zfET1zZBgnw== X-Received: by 2002:a2e:b446:: with SMTP id o6mr12037907ljm.80.1586172666105; Mon, 06 Apr 2020 04:31:06 -0700 (PDT) Received: from localhost.localdomain ([103.255.6.82]) by smtp.gmail.com with ESMTPSA id u25sm11273360lfm.97.2020.04.06.04.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 04:31:05 -0700 (PDT) From: Muhammad Bilal To: hemant.agrawal@nxp.com, olivier.matz@6wind.com Cc: dev@dpdk.org, Muhammad Bilal , stable@dpdk.org Date: Mon, 6 Apr 2020 16:30:20 +0500 Message-Id: <20200406113020.8074-1-m.bilal@emumba.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] putting null checks on ops_name X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Bugzilla ID: 353 Cc: dev@dpdk.org Cc: stable@dpdk.org Cc: hemant.agrawal@nxp.com Signed-off-by: Muhammad Bilal --- lib/librte_mbuf/rte_mbuf_pool_ops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf_pool_ops.c b/lib/librte_mbuf/rte_mbuf_pool_ops.c index 5722976fe..c3ddfc0bd 100644 --- a/lib/librte_mbuf/rte_mbuf_pool_ops.c +++ b/lib/librte_mbuf/rte_mbuf_pool_ops.c @@ -13,7 +13,8 @@ int rte_mbuf_set_platform_mempool_ops(const char *ops_name) { const struct rte_memzone *mz; - + if (strlen(ops_name) == 0) + return -1; if (strlen(ops_name) >= RTE_MEMPOOL_OPS_NAMESIZE) return -ENAMETOOLONG; @@ -50,7 +51,8 @@ int rte_mbuf_set_user_mempool_ops(const char *ops_name) { const struct rte_memzone *mz; - + if (strlen(ops_name) == 0) + return -1; if (strlen(ops_name) >= RTE_MEMPOOL_OPS_NAMESIZE) return -ENAMETOOLONG; -- 2.17.1