lcs: ensure proper ccw setup
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Mon, 24 Sep 2012 04:24:24 +0000 (04:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Sep 2012 19:45:17 +0000 (15:45 -0400)
Make sure that all ccws used for writing are initialized with
zeros - especially since the last ccw contains a TIC for which
the unused fields have to be zeros.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/lcs.c

index a3adf4b1c60d7e2e5efc074ce4fb6b2e7a6276be..2ca0f1dd7a00b857211348cf28d2c9e4a9df161a 100644 (file)
@@ -282,7 +282,7 @@ lcs_setup_write_ccws(struct lcs_card *card)
 
        LCS_DBF_TEXT(3, setup, "iwritccw");
        /* Setup write ccws. */
-       memset(card->write.ccws, 0, sizeof(struct ccw1) * LCS_NUM_BUFFS + 1);
+       memset(card->write.ccws, 0, sizeof(struct ccw1) * (LCS_NUM_BUFFS + 1));
        for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) {
                card->write.ccws[cnt].cmd_code = LCS_CCW_WRITE;
                card->write.ccws[cnt].count = 0;