Fix up IRDA drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.
- donauboe: intention appears to be to have the skb retransmitted without
error message
- irda-usb: intention is to drop silently according to comment
- kingsub-sir: skb is freed: use after free
- ks959-sir: skb is freed: use after free
- ksdazzle-sir: skb is freed: use after free
- mcs7880: skb is freed: use after free
All but donauboe compile tested.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
/* change speed pending, wait for its execution */
if (self->new_speed)
/* change speed pending, wait for its execution */
if (self->new_speed)
/* device stopped (apm) wait for restart */
if (self->stopped)
/* device stopped (apm) wait for restart */
if (self->stopped)
toshoboe_checkstuck (self);
toshoboe_checkstuck (self);
if (self->txpending)
{
spin_unlock_irqrestore(&self->spinlock, flags);
if (self->txpending)
{
spin_unlock_irqrestore(&self->spinlock, flags);
}
/* If in SIR mode we need to generate a string of XBOFs */
}
/* If in SIR mode we need to generate a string of XBOFs */
,skb->len, self->ring->tx[self->txs].control, self->txpending);
toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX);
spin_unlock_irqrestore(&self->spinlock, flags);
,skb->len, self->ring->tx[self->txs].control, self->txpending);
toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX);
spin_unlock_irqrestore(&self->spinlock, flags);
}
if (INB (OBOE_ENABLEH) & OBOE_ENABLEH_SIRON)
}
if (INB (OBOE_ENABLEH) & OBOE_ENABLEH_SIRON)
s32 speed;
s16 xbofs;
int res, mtt;
s32 speed;
s16 xbofs;
int res, mtt;
- int err = 1; /* Failed */
IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name);
IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name);
irda_usb_change_speed_xbofs(self);
netdev->trans_start = jiffies;
/* Will netif_wake_queue() in callback */
irda_usb_change_speed_xbofs(self);
netdev->trans_start = jiffies;
/* Will netif_wake_queue() in callback */
- err = 0; /* No error */
/* Drop silently the skb and exit */
dev_kfree_skb(skb);
spin_unlock_irqrestore(&self->lock, flags);
/* Drop silently the skb and exit */
dev_kfree_skb(skb);
spin_unlock_irqrestore(&self->lock, flags);
- return err; /* Usually 1 */
}
/*------------------------------------------------------------------*/
}
/*------------------------------------------------------------------*/
int wraplen;
int ret = 0;
int wraplen;
int ret = 0;
- if (skb == NULL || netdev == NULL)
- return -EINVAL;
-
netif_stop_queue(netdev);
/* the IRDA wrapping routines don't deal with non linear skb */
netif_stop_queue(netdev);
/* the IRDA wrapping routines don't deal with non linear skb */
dev_kfree_skb(skb);
spin_unlock(&kingsun->lock);
dev_kfree_skb(skb);
spin_unlock(&kingsun->lock);
}
/* Receive callback function */
}
/* Receive callback function */
unsigned int wraplen;
int ret = 0;
unsigned int wraplen;
int ret = 0;
- if (skb == NULL || netdev == NULL)
- return -EINVAL;
-
netif_stop_queue(netdev);
/* the IRDA wrapping routines don't deal with non linear skb */
netif_stop_queue(netdev);
/* the IRDA wrapping routines don't deal with non linear skb */
dev_kfree_skb(skb);
spin_unlock(&kingsun->lock);
dev_kfree_skb(skb);
spin_unlock(&kingsun->lock);
}
/* Receive callback function */
}
/* Receive callback function */
unsigned int wraplen;
int ret = 0;
unsigned int wraplen;
int ret = 0;
- if (skb == NULL || netdev == NULL)
- return -EINVAL;
-
netif_stop_queue(netdev);
/* the IRDA wrapping routines don't deal with non linear skb */
netif_stop_queue(netdev);
/* the IRDA wrapping routines don't deal with non linear skb */
dev_kfree_skb(skb);
spin_unlock(&kingsun->lock);
dev_kfree_skb(skb);
spin_unlock(&kingsun->lock);
}
/* Receive callback function */
}
/* Receive callback function */
int wraplen;
int ret = 0;
int wraplen;
int ret = 0;
-
- if (skb == NULL || ndev == NULL)
- return -EINVAL;
-
netif_stop_queue(ndev);
mcs = netdev_priv(ndev);
netif_stop_queue(ndev);
mcs = netdev_priv(ndev);
dev_kfree_skb(skb);
spin_unlock_irqrestore(&mcs->lock, flags);
dev_kfree_skb(skb);
spin_unlock_irqrestore(&mcs->lock, flags);
}
static const struct net_device_ops mcs_netdev_ops = {
}
static const struct net_device_ops mcs_netdev_ops = {