[PATCH net 1/2] net/stmmac: Protect against zero queue DTS config
Andrew Lunn
andrew at lunn.ch
Tue Jul 7 11:57:28 PDT 2026
On Tue, Jul 07, 2026 at 07:44:30PM +0200, Jakub Raczynski wrote:
> Commit 8a7bca6de6de protected against inputing number of tx/rx_queues_to_use
> over kernel supported limit in DTS config. AI review mentioned that we also
> should protect against zero queue input, because this would cause issues
> down the line. Missing config is not an issue as stmmac_plat_dat_alloc()
> does apply '1' by default.
>
> Fix this by adding check for zero queues input during DTS parsing
>
> Fixes: 8a7bca6de6de ("net/stmmac: Apply MTL_MAX queue limit if config missing")
I'm not sure a Fixes: is justified here. Does this bother somebody? As
far as i understand, for this to actually do something the system is
broken anyway?
> if (!of_property_read_u32(rx_node, "snps,rx-queues-to-use", &value)) {
> if (value > MTL_MAX_RX_QUEUES)
> value = MTL_MAX_RX_QUEUES;
> + else if (value == 0)
> + value = 1;
If the DT is broken, don't we want it to be fixed? -EINVAL would make
it obvious.
Andrew
---
pw-bot: cr
More information about the linux-arm-kernel
mailing list