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 9A2EAA034F; Wed, 9 Feb 2022 08:39:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D72F410FD; Wed, 9 Feb 2022 08:39:48 +0100 (CET) Received: from out203-205-221-153.mail.qq.com (out203-205-221-153.mail.qq.com [203.205.221.153]) by mails.dpdk.org (Postfix) with ESMTP id 7EC13410F3 for ; Wed, 9 Feb 2022 08:39:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1644392383; bh=dy6v4BKrUrHztURpGXYTY2jm1AZEqsxPVfkssEqxQ/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Zh8BHHfX7m3Q2E/8ydlRvihN11tJQVqkdxjArxnpZaCmBSwq/FckN/ShneP3kTQmm oTLPBk8DJnzvfZ1BprC1NPEGvZ9xZ7fg6FOMdAj5ekZiVwXr+4iZW8/rJWlxsG8ZJY 7rkJ45qtZgSLRMKsX0oHelYKbg//WCuPbm7XNZpg= Received: from liwg-ubuntu.lan ([111.193.130.237]) by newxmesmtplogicsvrszc7.qq.com (NewEsmtp) with SMTP id 9E2ADE35; Wed, 09 Feb 2022 15:39:34 +0800 X-QQ-mid: xmsmtpt1644392374tlf6hol92 Message-ID: X-QQ-XMAILINFO: MMnP0fEUKo/hTdFkx4DHOYPHPnrrtYJPBPkZfpHugg/GMARxsbltfIBvjy10Cj ULJ8VdBAODm3t/7NMok/OHhoyu+/QyQfCE7LnFsIqmdq3cF9jspRAnz+JQNOSN0ctNqOewFlrz25 1upwkrfXIF9JBg/ZqnX5rwdfALYLTQyWJ2c728a+J27RICTFSbCz3tLT3vlJUtYpN3TGHGVr5GXw JPaITwM2KAqjYNHU30IeZAA36s01tsIscwSxoo1w5Ut8H9kKtDgrnVtX+yFoiLk4HcPMr20d/mZe 1dCwCGAt2Dr7pY2pK09pBZR0QPaewWzg0zm24vd2Sy7hXEbX3arjV+vWp0hgVLyx3GqBAZmiNDg+ zx/FJ7GGlR0mShEVyd5EtdohKertmpmAQYwJLl0tTgG8IIn9Edb5kNzDLr1w9LkVInkfgR1073QB tfX3/rCvJP2Z4bccoDc0OQ48RZlRSI5478Lo6Gg62s2iZ/fnv5OCfBjhWRbJd9Dq8rSVIRI8Spzz NL6WNd6fnuGY9eSKkc/8BqrAbL/w0MZixl61pSFBuzGvhG8wLNZ5CvcdsKesBrUeoqGueXXApdlH +kcZ/jJR48SpmcPrOvi0+XuqLSGtfKQsn/f7gtynV9YbbY59bBYSODIZZXAcwzDWVsfP3NyOFT/U VUkRc6GBl9AodjvbqkUIH8oBSWWqPHjT7RhNS0qmz4HRJO+G5ZORv4COYf4ydlqZfhOLCJfR9HC0 XrWbLYpmpcpWyf7dp93YuRa6Kamg+S7b1uOuWn3fYMjqP5GNRnYH+LUXAfWT9jrL/ALDp8nkY8ho 1O6Jv6ZQbarmrlbwxYFkJq4XE66dfdbdVmt4bmMFLmqG8rJ251TsSbj3/fShI8CUQ= From: Weiguo Li To: jgrajcia@cisco.com Cc: dev@dpdk.org Subject: [PATCH v2] net/memif: remove pointer deference before null check Date: Wed, 9 Feb 2022 15:39:34 +0800 X-OQ-MSGID: <20220209073934.3835213-1-liwg06@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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 There are duplicates of assignment here, the one before null check may cause a null pointer deference, so remove the previous one. Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") Signed-off-by: Weiguo Li --- v2: * fix typo --- drivers/net/memif/memif_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c index 42f48a68a1..7886644412 100644 --- a/drivers/net/memif/memif_socket.c +++ b/drivers/net/memif/memif_socket.c @@ -402,11 +402,10 @@ memif_msg_enq_init(struct rte_eth_dev *dev) { struct pmd_internals *pmd = dev->data->dev_private; struct memif_msg_queue_elt *e = memif_msg_enq(pmd->cc); - memif_msg_init_t *i = &e->msg.init; + memif_msg_init_t *i; if (e == NULL) return -1; - i = &e->msg.init; e->msg.type = MEMIF_MSG_TYPE_INIT; i->version = MEMIF_VERSION; -- 2.25.1