]> git.openfabrics.org - ~emulex/for-vlad/old/compat-rdma.git/commitdiff
cxgb4: Initialize data structures before using.
authorVipul Pandya <vipul@chelsio.com>
Tue, 6 Nov 2012 12:33:02 +0000 (04:33 -0800)
committerVipul Pandya <vipul@chelsio.com>
Tue, 6 Nov 2012 12:33:44 +0000 (04:33 -0800)
We should not assume reserve fields to be don't cares as fields may change.
Clearing data structures before using.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
linux-next-pending/0017-cxgb4-Initialize-data-structures-before-using.patch [new file with mode: 0644]

diff --git a/linux-next-pending/0017-cxgb4-Initialize-data-structures-before-using.patch b/linux-next-pending/0017-cxgb4-Initialize-data-structures-before-using.patch
new file mode 100644 (file)
index 0000000..7f021c2
--- /dev/null
@@ -0,0 +1,53 @@
+From 720928d927ed05a8415c1b75bda10dd44a903720 Mon Sep 17 00:00:00 2001
+From: Vipul Pandya <vipul@chelsio.com>
+Date: Tue, 6 Nov 2012 17:04:03 +0530
+Subject: [PATCH net] cxgb4: Initialize data structures before using.
+
+We should not assume reserve fields to be don't cares as fields may change.
+Clearing data structures before using.
+
+Signed-off-by: Jay Hernandez <jay@chelsio.com>
+Signed-off-by: Vipul Pandya <vipul@chelsio.com>
+---
+ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+index 32eec15..01fa5b7 100644
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+@@ -2519,6 +2519,7 @@ int t4_fw_bye(struct adapter *adap, unsigned int mbox)
+ {
+       struct fw_bye_cmd c;
++      memset(&c, 0, sizeof(c));
+       INIT_CMD(c, BYE, WRITE);
+       return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
+ }
+@@ -2535,6 +2536,7 @@ int t4_early_init(struct adapter *adap, unsigned int mbox)
+ {
+       struct fw_initialize_cmd c;
++      memset(&c, 0, sizeof(c));
+       INIT_CMD(c, INITIALIZE, WRITE);
+       return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
+ }
+@@ -2551,6 +2553,7 @@ int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset)
+ {
+       struct fw_reset_cmd c;
++      memset(&c, 0, sizeof(c));
+       INIT_CMD(c, RESET, WRITE);
+       c.val = htonl(reset);
+       return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
+@@ -3278,6 +3281,7 @@ int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
+ {
+       struct fw_vi_enable_cmd c;
++      memset(&c, 0, sizeof(c));
+       c.op_to_viid = htonl(FW_CMD_OP(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST |
+                            FW_CMD_EXEC | FW_VI_ENABLE_CMD_VIID(viid));
+       c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_LED | FW_LEN16(c));
+-- 
+1.7.1
+