Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0311d977 authored by Catherine Sullivan's avatar Catherine Sullivan Committed by Greg Kroah-Hartman
Browse files

gve: Correct available tx qpl check



[ Upstream commit d03477ee10f4bc35d3573cf1823814378ef2dca2 ]

The qpl_map_size is rounded up to a multiple of sizeof(long), but the
number of qpls doesn't have to be.

Fixes: f5cedc84 ("gve: Add transmit and receive support")
Signed-off-by: default avatarCatherine Sullivan <csully@google.com>
Signed-off-by: default avatarJeroen de Borst <jeroendb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 11cd944b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -391,7 +391,7 @@ struct gve_queue_page_list *gve_assign_rx_qpl(struct gve_priv *priv)
				    gve_num_tx_qpls(priv));

	/* we are out of rx qpls */
	if (id == priv->qpl_cfg.qpl_map_size)
	if (id == gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv))
		return NULL;

	set_bit(id, priv->qpl_cfg.qpl_id_map);