From: Jack Morgenstein <jackm@dev.mellanox.co.il>
To: Or Gerlitz <gerlitz.or@gmail.com>
Cc: Carol L Soto <clsoto@linux.vnet.ibm.com>,
David Miller <davem@davemloft.net>,
Linux Netdev List <netdev@vger.kernel.org>,
Or Gerlitz <ogerlitz@mellanox.com>,
brking@linux.vnet.ibm.com,
Yevgeny Petrilin <yevgenyp@mellanox.com>,
Yishai Hadas <yishaih@mellanox.com>
Subject: Re: [PATCH] net/mlx4: Memcpy at slave_event should copy sizeof mlx4_eqe
Date: Sun, 25 Oct 2015 12:07:43 +0200 [thread overview]
Message-ID: <20151025120743.3763b796@jpm-OptiPlex-GX620> (raw)
In-Reply-To: <CAJ3xEMiYZgGNqHffxDe4ixPECHwQ2cSbvVjHmjc49kROm=9p5g@mail.gmail.com>
Hi Carol,
Good catch!
Need to add an additional chunk to your fix -- see below.
On Sun, 25 Oct 2015 10:26:07 +0200
Or Gerlitz <gerlitz.or@gmail.com> wrote:
>
> > ---
> > drivers/net/ethernet/mellanox/mlx4/eq.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c
> > b/drivers/net/ethernet/mellanox/mlx4/eq.c index c344884..603d1c3
> > 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c
> > +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
> > @@ -196,7 +196,7 @@ static void slave_event(struct mlx4_dev *dev,
> > u8 slave, struct mlx4_eqe *eqe) return;
> > }
> >
> > - memcpy(s_eqe, eqe, dev->caps.eqe_size - 1);
> > + memcpy(s_eqe, eqe, sizeof(struct mlx4_eqe) - 1);
> > s_eqe->slave_id = slave;
> > /* ensure all information is written before setting the
> > ownersip bit */ dma_wmb();
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 0a32020..2177e56 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -2398,7 +2398,7 @@ int mlx4_multi_func_init(struct mlx4_dev *dev)
}
}
- memset(&priv->mfunc.master.cmd_eqe, 0, dev->caps.eqe_size);
+ memset(&priv->mfunc.master.cmd_eqe, 0, sizeof(struct mlx4_eqe));
priv->mfunc.master.cmd_eqe.type = MLX4_EVENT_TYPE_CMD;
INIT_WORK(&priv->mfunc.master.comm_work,
mlx4_master_comm_channel);
> > --
> > 1.8.3.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-10-25 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 14:19 [PATCH] net/mlx4: Memcpy at slave_event should copy sizeof mlx4_eqe clsoto
2015-10-25 8:26 ` Or Gerlitz
2015-10-25 10:07 ` Jack Morgenstein [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151025120743.3763b796@jpm-OptiPlex-GX620 \
--to=jackm@dev.mellanox.co.il \
--cc=brking@linux.vnet.ibm.com \
--cc=clsoto@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=gerlitz.or@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=yevgenyp@mellanox.com \
--cc=yishaih@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox