staging: axis-fifo: fix integer underflow in tx_fifo_depth
Subsystems (2)
PATCH 1/1 staging: axis-fifo: fix integer underflow in tx_fifo_depth
Fix integer underflow if tx_fifo_depth < 4 in axis-fifo.c due to check in axis_fifo_write() subtracting 4.
--- drivers/staging/axis-fifo/axis-fifo.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/staging/axis-fifo/axis-fifo.c +5 -0
@@ -413,6 +413,11 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)if (ret)return ret; +if (fifo->tx_fifo_depth <4 ) { +dev_err (fifo->dt_device,"tx_fifo_depth must be >= 4\n" ); +return -EINVAL ; + } + ret =of_property_read_u32 (node,"xlnx,use-rx-data" , &fifo->has_rx_fifo);if (ret)
Signature · 1 line
2.53.0
Quoted 7 lines · Vladan Kalaba
Fix integer underflow if
tx_fifo_depth< 4 inaxis-fifo.cdue to check inaxis_fifo_write()subtracting 4.Fixes 52ff2b840bc7 ("staging: axis-fifo: fix maximum TX packet length check")Signed-off-by Vladan Kalaba <[email protected]>---
This has been sent a number of times before. The information comes from device tree and we trust the device tree.
regards,
dan carpenter
Quoted 10 lines · Dan Carpenter
Quoted 7 lines · Vladan Kalaba
Fix integer underflow if
tx_fifo_depth< 4 inaxis-fifo.cdue to check inaxis_fifo_write()subtracting 4.Fixes 52ff2b840bc7 ("staging: axis-fifo: fix maximum TX packet length check")Signed-off-by Vladan Kalaba <[email protected]>---
Quoted 6 lines
This has been sent a number of times before. The information comes from device tree and we trust the device tree.
regards,
dan carpenter
Hi Dan,
Thanks for letting me know, I will keep that in mind in future.
Sincerely,
Vladan
Greg KH
maintainerQuoted 9 lines · Vladan Kalaba
Fix integer underflow if
tx_fifo_depth< 4 inaxis-fifo.cdue to check inaxis_fifo_write()subtracting 4.Fixes 52ff2b840bc7 ("staging: axis-fifo: fix maximum TX packet length check")Signed-off-by Vladan Kalaba <[email protected]>--- drivers/staging/axis-fifo/axis-fifo.c | 5 +++++ 1 file changed, 5 insertions(+)
Did you forget an "Assisted-by:" tag for this?