All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] octeontx2-af: Copy the right amount of memory
@ 2018-10-24  8:32 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-10-24  8:32 UTC (permalink / raw)
  To: Sunil Goutham
  Cc: Linu Cherian, Geetha sowjanya, Jerin Jacob, David S. Miller,
	netdev, kernel-janitors

This is a copy and paste bug where we copied the sizeof() from the chunk
before.  We're copying more data than intended but the destination is a
union so it doesn't cause memory corruption.

Fixes: ffb0abd7e9cb ("octeontx2-af: NIX AQ instruction enqueue support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
index 8890c95831ca..a4eac3b9ee72 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
@@ -573,7 +573,7 @@ static int rvu_nix_aq_enq_inst(struct rvu *rvu, struct nix_aq_enq_req *req,
 				       sizeof(struct nix_cq_ctx_s));
 			else if (req->ctype == NIX_AQ_CTYPE_RSS)
 				memcpy(&rsp->rss, ctx,
-				       sizeof(struct nix_cq_ctx_s));
+				       sizeof(struct nix_rsse_s));
 			else if (req->ctype == NIX_AQ_CTYPE_MCE)
 				memcpy(&rsp->mce, ctx,
 				       sizeof(struct nix_rx_mce_s));
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next] octeontx2-af: Copy the right amount of memory
@ 2018-10-24  8:32 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-10-24  8:32 UTC (permalink / raw)
  To: Sunil Goutham
  Cc: Linu Cherian, Geetha sowjanya, Jerin Jacob, David S. Miller,
	netdev, kernel-janitors

This is a copy and paste bug where we copied the sizeof() from the chunk
before.  We're copying more data than intended but the destination is a
union so it doesn't cause memory corruption.

Fixes: ffb0abd7e9cb ("octeontx2-af: NIX AQ instruction enqueue support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
index 8890c95831ca..a4eac3b9ee72 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
@@ -573,7 +573,7 @@ static int rvu_nix_aq_enq_inst(struct rvu *rvu, struct nix_aq_enq_req *req,
 				       sizeof(struct nix_cq_ctx_s));
 			else if (req->ctype = NIX_AQ_CTYPE_RSS)
 				memcpy(&rsp->rss, ctx,
-				       sizeof(struct nix_cq_ctx_s));
+				       sizeof(struct nix_rsse_s));
 			else if (req->ctype = NIX_AQ_CTYPE_MCE)
 				memcpy(&rsp->mce, ctx,
 				       sizeof(struct nix_rx_mce_s));
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] octeontx2-af: Copy the right amount of memory
  2018-10-24  8:32 ` Dan Carpenter
@ 2018-10-24 21:25   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-10-24 21:25 UTC (permalink / raw)
  To: dan.carpenter; +Cc: sgoutham, lcherian, gakula, jerinj, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 24 Oct 2018 11:32:21 +0300

> This is a copy and paste bug where we copied the sizeof() from the chunk
> before.  We're copying more data than intended but the destination is a
> union so it doesn't cause memory corruption.
> 
> Fixes: ffb0abd7e9cb ("octeontx2-af: NIX AQ instruction enqueue support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks Dan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] octeontx2-af: Copy the right amount of memory
@ 2018-10-24 21:25   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-10-24 21:25 UTC (permalink / raw)
  To: dan.carpenter; +Cc: sgoutham, lcherian, gakula, jerinj, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 24 Oct 2018 11:32:21 +0300

> This is a copy and paste bug where we copied the sizeof() from the chunk
> before.  We're copying more data than intended but the destination is a
> union so it doesn't cause memory corruption.
> 
> Fixes: ffb0abd7e9cb ("octeontx2-af: NIX AQ instruction enqueue support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks Dan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-25  5:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24  8:32 [PATCH net-next] octeontx2-af: Copy the right amount of memory Dan Carpenter
2018-10-24  8:32 ` Dan Carpenter
2018-10-24 21:25 ` David Miller
2018-10-24 21:25   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.