<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt">    Reviewed-by: John Daley <a href="mailto:johndale@cisco.com">
johndale@cisco.com</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Chengwen Feng <fengchengwen@huawei.com><br>
<b>Date: </b>Monday, March 20, 2023 at 2:28 AM<br>
<b>To: </b>thomas@monjalon.net <thomas@monjalon.net>, ferruh.yigit@amd.com <ferruh.yigit@amd.com>, John Daley (johndale) <johndale@cisco.com>, Hyong Youb Kim (hyonkim) <hyonkim@cisco.com><br>
<b>Cc: </b>dev@dpdk.org <dev@dpdk.org><br>
<b>Subject: </b>[PATCH v2 13/44] net/enic: fix segment fault when parse devargs<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">The rte_kvargs_process() was used to parse KV pairs, it also supports<br>
to parse 'only keys' (e.g. socket_id) type. And the callback function<br>
parameter 'value' is NULL when parsed 'only keys'.<br>
<br>
This patch fixes segment fault when parse input args with 'only keys'.<br>
<br>
Fixes: 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE")<br>
Fixes: e39c2756e21a ("net/enic: add devarg to specify ingress VLAN rewrite mode")<br>
Cc: stable@dpdk.org<br>
<br>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com><br>
---<br>
 drivers/net/enic/enic_ethdev.c | 6 ++++++<br>
 1 file changed, 6 insertions(+)<br>
<br>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c<br>
index cdf0915591..b67016e0a3 100644<br>
--- a/drivers/net/enic/enic_ethdev.c<br>
+++ b/drivers/net/enic/enic_ethdev.c<br>
@@ -1148,6 +1148,9 @@ static int enic_parse_zero_one(const char *key,<br>
         struct enic *enic;<br>
         bool b;<br>
 <br>
+       if (value == NULL)<br>
+               return -EINVAL;<br>
+<br>
         enic = (struct enic *)opaque;<br>
         if (strcmp(value, "0") == 0) {<br>
                 b = false;<br>
@@ -1173,6 +1176,9 @@ static int enic_parse_ig_vlan_rewrite(__rte_unused const char *key,<br>
 {<br>
         struct enic *enic;<br>
 <br>
+       if (value == NULL)<br>
+               return -EINVAL;<br>
+<br>
         enic = (struct enic *)opaque;<br>
         if (strcmp(value, "trunk") == 0) {<br>
                 /* Trunk mode: always tag */<br>
-- <br>
2.17.1<o:p></o:p></span></p>
</div>
</div>
</body>
</html>