Skip to content

Commit 5942381

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: stmmac: ensure jumbo_frm error return is correctly checked for -ve value
The current comparison of entry < 0 will never be true since entry is an unsigned integer. Make entry an int to ensure -ve error return values from the call to jumbo_frm are correctly being caught. Detected by CoverityScan, CID#1238760 ("Macro compares unsigned to 0") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7b868fe commit 5942381

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
29472947
int i, csum_insertion = 0, is_jumbo = 0;
29482948
u32 queue = skb_get_queue_mapping(skb);
29492949
int nfrags = skb_shinfo(skb)->nr_frags;
2950-
unsigned int entry, first_entry;
2950+
int entry;
2951+
unsigned int first_entry;
29512952
struct dma_desc *desc, *first;
29522953
struct stmmac_tx_queue *tx_q;
29532954
unsigned int enh_desc;

0 commit comments

Comments
 (0)