[PATCH 5.10 1/1] eth: ena: Check return value of xdp_convert_buff_to_frame

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return value of a function 'xdp_convert_buff_to_frame' is dereferenced
without checking for null, but it is usually checked for this function.

This fixed in upstream commit <e8223eeff02> while refactoring.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Peter Kosyh <pkosyh@xxxxxxxxx>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 52414ac2c901..9e6b2bd73dac 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -237,6 +237,8 @@ static int ena_xdp_tx_map_buff(struct ena_ring *xdp_ring,
 	u32 size;
 
 	tx_info->xdpf = xdp_convert_buff_to_frame(xdp);
+	if (unlikely(!tx_info->xdpf))
+		goto error_report_dma_error;
 	size = tx_info->xdpf->len;
 	ena_buf = tx_info->bufs;
 
-- 
2.37.0




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux