Thread (4 messages) flat view 4 messages, 3 authors, 2012-11-07

Re: [PATCH net] cxgb4: Initialize data structures before using.

From: Viral Mehta <hidden>
Date: 2012-11-07 11:12:10

Hi,

On Tue, Nov 6, 2012 at 7:07 PM, Vipul Pandya [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
Signed-off-by: Vipul Pandya <redacted>
---
 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));
struct fw_byte_cmd c = {0};

Isn't it better ?

Thanks,
Viral
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help