net/mlx4_core: Initialize all mailbox buffers to zero before use
[cascardo/linux.git] / drivers / net / ethernet / mellanox / mlx4 / port.c
index caaa154..97d342f 100644 (file)
@@ -469,8 +469,6 @@ int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps)
 
        inbuf = inmailbox->buf;
        outbuf = outmailbox->buf;
-       memset(inbuf, 0, 256);
-       memset(outbuf, 0, 256);
        inbuf[0] = 1;
        inbuf[1] = 1;
        inbuf[2] = 1;
@@ -653,8 +651,6 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
 
-       memset(mailbox->buf, 0, 256);
-
        ((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
 
        if (pkey_tbl_sz >= 0 && mlx4_is_master(dev)) {
@@ -692,8 +688,6 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
-
        context->flags = SET_PORT_GEN_ALL_VALID;
        context->mtu = cpu_to_be16(mtu);
        context->pptx = (pptx * (!pfctx)) << 7;
@@ -727,8 +721,6 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
-
        context->base_qpn = cpu_to_be32(base_qpn);
        context->n_mac = dev->caps.log_num_macs;
        context->promisc = cpu_to_be32(promisc << SET_PORT_PROMISC_SHIFT |
@@ -761,8 +753,6 @@ int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc)
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
-
        for (i = 0; i < MLX4_NUM_UP; i += 2)
                context->prio2tc[i >> 1] = prio2tc[i] << 4 | prio2tc[i + 1];
 
@@ -788,7 +778,6 @@ int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
 
        for (i = 0; i < MLX4_NUM_TC; i++) {
                struct mlx4_port_scheduler_tc_cfg_be *tc = &context->tc[i];