]> git.droids-corp.org - dpdk.git/commitdiff
net/memif: remove pointer deference before null check
authorWeiguo Li <liwg06@foxmail.com>
Wed, 9 Feb 2022 07:39:34 +0000 (15:39 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 9 Feb 2022 17:50:50 +0000 (18:50 +0100)
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")
Cc: stable@dpdk.org
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/memif/memif_socket.c

index 42f48a68a1d4f6369886d92d5704fe9b1196fcd1..78866444124b4038d60c7cd334281e8ca42439f0 100644 (file)
@@ -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;