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

Message ID 1491808736-14239-1-git-send-email-shijith.thotton@caviumnetworks.com (mailing list archive)
State Accepted, 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, 7:18 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>
---
v2 changes:
 - Fix typo in commit title (s/liquidioi/liquidio).

 drivers/net/liquidio/base/lio_23xx_vf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit April 10, 2017, 10:07 a.m. UTC | #1
On 4/10/2017 8:18 AM, Shijith Thotton wrote:
> 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>

Series applied to dpdk-next-net/master, thanks.


Updated commit logs with the defined syntax for Coverity fixes:

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

    Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
  

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;