linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: net: xgene: initialize slots
@ 2016-12-08 11:17 Colin King
  2016-12-08 18:44 ` Iyappan Subramanian
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-12-08 11:17 UTC (permalink / raw)
  To: Iyappan Subramanian, Keyur Chudgar, netdev; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

static analysis using cppcheck detected that slots was uninitialized.
Fix this by initializing it to buf_pool->slots - 1

Found using static analysis with CoverityScan, CID #1387620

Fixes: a9380b0f7be818 ("drivers: net: xgene: Add support for Jumbo frame")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 6c7eea8..899163c 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -636,6 +636,7 @@ static void xgene_enet_free_pagepool(struct xgene_enet_desc_ring *buf_pool,
 
 	dev = ndev_to_dev(buf_pool->ndev);
 	head = buf_pool->head;
+	slots = buf_pool->slots - 1;
 
 	for (i = 0; i < 4; i++) {
 		frag_size = xgene_enet_get_data_len(le64_to_cpu(desc[i ^ 1]));
-- 
2.10.2

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

end of thread, other threads:[~2016-12-08 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08 11:17 [PATCH] drivers: net: xgene: initialize slots Colin King
2016-12-08 18:44 ` Iyappan Subramanian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).