net: stmmac: stmmac_is_jumbo_frm() len should be unsigned
stmmac_is_jumbo_frm() and the is_jumbo_frm() methods take skb->len which is an unsigned int. Avoid an implicit cast to "int" via the method parameter and then incorrectly doing signed comparisons on this unsigned value. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/E1vLIWR-0000000Ewkf-1Tdx@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
7ac60a14d3
commit
b5adada61e
@@ -83,7 +83,7 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
|
||||
return entry;
|
||||
}
|
||||
|
||||
static unsigned int is_jumbo_frm(int len, int enh_desc)
|
||||
static unsigned int is_jumbo_frm(unsigned int len, int enh_desc)
|
||||
{
|
||||
unsigned int ret = 0;
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ struct stmmac_rx_queue;
|
||||
struct stmmac_mode_ops {
|
||||
void (*init) (void *des, dma_addr_t phy_addr, unsigned int size,
|
||||
unsigned int extend_desc);
|
||||
unsigned int (*is_jumbo_frm) (int len, int ehn_desc);
|
||||
unsigned int (*is_jumbo_frm)(unsigned int len, int ehn_desc);
|
||||
int (*jumbo_frm)(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
|
||||
int csum);
|
||||
int (*set_16kib_bfsize)(int mtu);
|
||||
|
||||
@@ -91,7 +91,7 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
|
||||
return entry;
|
||||
}
|
||||
|
||||
static unsigned int is_jumbo_frm(int len, int enh_desc)
|
||||
static unsigned int is_jumbo_frm(unsigned int len, int enh_desc)
|
||||
{
|
||||
unsigned int ret = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user