[dpdk-dev,1/2] net/liquidioi/base: fix mbox command initialization

Message ID 1491805567-10743-1-git-send-email-shijith.thotton@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shijith Thotton April 10, 2017, 6:26 a.m. UTC
  Initialize mail box command to request VF FLR. Data field was
uninitialized before as it was not required and caused the following
error during scan.

Reported by Coverity scan:
1384518 Uninitialized scalar variable

Fixes: cdb166963cae ("net/liquidio: add API for VF FLR")

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
 drivers/net/liquidio/base/lio_23xx_vf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 6ff5b69..e30c20d 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -31,6 +31,8 @@ 
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <string.h>
+
 #include <rte_ethdev.h>
 #include <rte_cycles.h>
 #include <rte_malloc.h>
@@ -382,7 +384,7 @@ 
 {
 	struct lio_mbox_cmd mbox_cmd;
 
-	mbox_cmd.msg.mbox_msg64 = 0;
+	memset(&mbox_cmd, 0, sizeof(struct lio_mbox_cmd));
 	mbox_cmd.msg.s.type = LIO_MBOX_REQUEST;
 	mbox_cmd.msg.s.resp_needed = 0;
 	mbox_cmd.msg.s.cmd = LIO_VF_FLR_REQUEST;