Skip to contentSkip to conversation

liquidio: clear the correct memory

PATCH Applied Dan Carpenter 3 participants 3 messages Apr 3, 2017 – Apr 5, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 liquidio: clear the correct memory

There is a cut and paste bug here so we accidentally clear the first few bytes of "resp" a second time instead clearing "ctx".

Fixes 50c0add534d2 ("liquidio: refactor interrupt moderation code")
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +1 -1
index fac02ed2c449..dab10c7e4443 100644
@@ -1359,7 +1359,7 @@ static int octnet_get_intrmod_cfg(struct lio *lio,
 	memset(resp, 0, sizeof(struct oct_intrmod_resp));
 
 	ctx = (struct oct_intrmod_context *)sc->ctxptr;
-	memset(resp, 0, sizeof(struct oct_intrmod_context));
+	memset(ctx, 0, sizeof(struct oct_intrmod_context));
 	WRITE_ONCE(ctx->cond, 0);
 	ctx->octeon_id = lio_get_device_id(oct_dev);
 	init_waitqueue_head(&ctx->wc);
Acked-by on v1 1/1
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Mon, 2017-Apr-03 21:18:27 +0300

Quoted 11 lines

There is a cut and paste bug here so we accidentally clear the first few bytes of "resp" a second time instead clearing "ctx".

Fixes 50c0add534d2 ("liquidio: refactor interrupt moderation code")
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +0 -0
index fac02ed2c449..dab10c7e4443 100644

drivers/net/ethernet/cavium/liquidio/lio_ethtool.c static int octnet_get_intrmod_cfg(struct lio *lio, · line 1365

Quoted 8 lines
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +1 -1
@@ -1359,7 +1359,7 @@ static int octnet_get_intrmod_cfg(struct lio *lio,
 	memset(resp, 0, sizeof(struct oct_intrmod_resp));
 
 	ctx = (struct oct_intrmod_context *)sc->ctxptr;
-	memset(resp, 0, sizeof(struct oct_intrmod_context));
+	memset(ctx, 0, sizeof(struct oct_intrmod_context));
 	WRITE_ONCE(ctx->cond, 0);
 	ctx->octeon_id = lio_get_device_id(oct_dev);
 	init_waitqueue_head(&ctx->wc);

Good catch, Dan. Thanks.