liquidio: clear the correct memory
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")
Signed-off-by Dan Carpenter <[email protected]>
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);
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")Signed-off-by Dan Carpenter <[email protected]>drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +0
-0
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.
Acked-by Felix Manlunas <[email protected]>
From: Dan Carpenter <[email protected]>
Date: Mon, 3 Apr 2017 21:18:27 +0300
Quoted 5 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")Signed-off-by Dan Carpenter <[email protected]>
Applied.