1. 17 12月, 2016 6 次提交
    • J
      encx24j600: bugfix - always move ERXTAIL to next packet in encx24j600_rx_packets · ebe5236d
      Jeroen De Wachter 提交于
      Before, encx24j600_rx_packets did not update encx24j600_priv's next_packet
      member when an error occurred during packet handling (either because the
      packet's RSV header indicates an error or because the encx24j600_receive_packet
      method can't allocate an sk_buff).
      
      If the next_packet member is not updated, the ERXTAIL register will be set to
      the same value it had before, which means the bad packet remains in the
      component's memory and its RSV header will be read again when a new packet
      arrives. If the RSV header indicates a bad packet or if sk_buff allocation
      continues to fail, new packets will be stored in the component's memory until
      that memory is full, after which packets will be dropped.
      
      The SETPKTDEC command is always executed though, so the encx24j600 hardware has
      an incorrect count of the packets in its memory.
      
      To prevent this, the next_packet member should always be updated, allowing the
      packet to be skipped (either because it's bad, as indicated in its RSV header,
      or because allocating an sk_buff failed). In the allocation failure case, this
      does mean dropping a valid packet, but dropping the oldest packet to keep as
      much memory as possible available for new packets seems preferable to keeping
      old (but valid) packets around while dropping new ones.
      Signed-off-by: NJeroen De Wachter <jeroen.de_wachter.ext@nokia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ebe5236d
    • D
      Merge branch 'hisilicon-netdev-dev' · ea7a2b9a
      David S. Miller 提交于
      Dongpo Li says:
      
      ====================
      net: ethernet: hisilicon: set dev->dev.parent before PHY connect
      
      This patch series builds atop:
      ec988ad7 ("phy: Don't increment MDIO bus
      refcount unless it's a different owner")
      
      I have checked all the hisilicon ethernet driver and found only two drivers
      need to be fixed to make sure set dev->dev.parent before PHY connect.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea7a2b9a
    • D
      net: ethernet: hip04: Call SET_NETDEV_DEV() · 8cd1f70f
      Dongpo Li 提交于
      The hip04 driver calls into PHYLIB which now checks for
      net_device->dev.parent, so make sure we do set it before calling into
      any MDIO/PHYLIB related function.
      
      Fixes: ec988ad7 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
      Signed-off-by: NDongpo Li <lidongpo@hisilicon.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8cd1f70f
    • D
      net: ethernet: hisi_femac: Call SET_NETDEV_DEV() · 2087d421
      Dongpo Li 提交于
      The hisi_femac driver calls into PHYLIB which now checks for
      net_device->dev.parent, so make sure we do set it before calling into
      any MDIO/PHYLIB related function.
      
      Fixes: ec988ad7 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
      Signed-off-by: NDongpo Li <lidongpo@hisilicon.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2087d421
    • A
      net: dsa: mv88e6xxx: Fix opps when adding vlan bridge · 66e2809d
      Andrew Lunn 提交于
      A port is not necessarily assigned to a netdev. And a port does not
      need to be a member of a bridge. So when iterating over all ports,
      check before using the netdev and bridge_dev for a port. Otherwise we
      dereference a NULL pointer.
      
      Fixes: da9c359e ("net: dsa: mv88e6xxx: check hardware VLAN in use")
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66e2809d
    • T
      net/3com/3c515: Fix timer handling, prevent leaks and crashes · e28ceeb1
      Thomas Gleixner 提交于
      The timer handling in this driver is broken in several ways:
      
      - corkscrew_open() initializes and arms a timer before requesting the
        device interrupt. If the request fails the timer stays armed.
      
        A second call to corkscrew_open will unconditionally reinitialize the
        quued timer and arm it again. Also a immediate device removal will leave
        the timer queued because close() is not called (open() failed) and
        therefore nothing issues del_timer().
      
        The reinitialization corrupts the link chain in the timer wheel hash
        bucket and causes a NULL pointer dereference when the timer wheel tries
        to operate on that hash bucket. Immediate device removal lets the link
        chain poke into freed and possibly reused memory.
      
        Solution: Arm the timer after the successful irq request.
      
      - corkscrew_close() uses del_timer()
      
        On close the timer is disarmed with del_timer() which lets the following
        code race against a concurrent timer expiry function.
      
        Solution: Use del_timer_sync() instead
      
      - corkscrew_close() calls del_timer() unconditionally
      
        del_timer() is invoked even if the timer was never initialized. This
        works by chance because the struct containing the timer is zeroed at
        allocation time.
      
        Solution: Move the setup of the timer into corkscrew_setup().
      Reported-by: NMatthew Whitehead <tedheadster@gmail.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e28ceeb1
  2. 14 12月, 2016 1 次提交
  3. 13 12月, 2016 7 次提交
  4. 12 12月, 2016 26 次提交