20 Jul, 2016

1 commit


01 Jul, 2016

1 commit

  • Convert a call to init_timer and accompanying intializations of
    the timer's data and function fields to a call to setup_timer.

    The Coccinelle semantic patch that fixes this problem is
    as follows:
    @@
    expression t,d,f,e1;
    identifier x1;
    statement S1;
    @@

    (
    -t.data = d;
    |
    -t.function = f;
    |
    -init_timer(&t);
    +setup_timer(&t,f,d);
    |
    -init_timer_on_stack(&t);
    +setup_timer_on_stack(&t,f,d);
    )

    Signed-off-by: Amitoj Kaur Chawla
    Signed-off-by: David S. Miller

    Amitoj Kaur Chawla
     

01 Jun, 2016

2 commits

  • The iadev->rx_open[] array holds "iadev->num_vc" pointers (this code
    assumes that pointers are 32 bits). So the > here should be >= or else
    we could end up reading a garbage pointer from one element beyond the
    end of the array.

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • This bug was there when the driver was first added in back in year 2000.
    It causes a Smatch warning:

    drivers/atm/firestream.c:849 process_incoming()
    error: buffer overflow 'res_strings' 60
    Signed-off-by: David S. Miller

    Dan Carpenter
     

18 Mar, 2016

1 commit


15 Feb, 2016

1 commit


30 Dec, 2015

1 commit


06 Dec, 2015

1 commit


13 Oct, 2015

2 commits


18 Sep, 2015

1 commit

  • A comment in include/linux/skbuff.h says that:

    * Various parts of the networking layer expect at least 32 bytes of
    * headroom, you should not reduce this.

    This was demonstrated by a panic when handling fragmented IPv6 packets:
    http://marc.info/?l=linux-netdev&m=144236093519172&w=2

    It's not entirely clear if that comment is still valid — and if it is,
    perhaps netif_rx() ought to be enforcing it with a warning.

    But either way, it is rather stupid from a performance point of view
    for us to be receiving packets into a buffer which doesn't have enough
    room to prepend an Ethernet header — it means that *every* incoming
    packet is going to be need to be reallocated. So let's fix that.

    Signed-off-by: David Woodhouse
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    David Woodhouse
     

16 Sep, 2015

1 commit

  • Remove unneeded NULL test.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@ expression x; @@
    -if (x != NULL)
    \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

11 Jun, 2015

1 commit

  • Use the timer API function setup_timer instead of structure field
    assignments to initialize a timer.

    A simplified version of the Coccinelle semantic patch that performs
    this transformation is as follows:

    @change@
    expression e1, e2, a;
    @@

    -init_timer(&e1);
    +setup_timer(&e1, a, 0UL);
    ... when != a = e2
    -e1.function = a;

    Signed-off-by: Vaishali Thakkar
    Signed-off-by: David S. Miller

    Vaishali Thakkar
     

09 Jun, 2015

1 commit

  • API compliance scanning with coccinelle flagged:
    ./drivers/atm/iphase.c:2621:4-20:
    WARNING: timeout (50) seems HZ dependent

    Numeric constants passed to schedule_timeout() make the effective
    timeout HZ dependent which does not seem intended.
    Fixed up by converting the constant to jiffies with msecs_to_jiffies()
    As this driver was introduced in the early 2.3 series it is most
    likely assuming HZ=100 so the constant 50 is converted to 500ms.

    Signed-off-by: Nicholas Mc Guire
    Signed-off-by: David S. Miller

    Nicholas Mc Guire
     

05 Jun, 2015

1 commit


26 May, 2015

1 commit


11 Mar, 2015

1 commit


18 Jan, 2015

1 commit


14 Jan, 2015

2 commits


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

30 Nov, 2014

1 commit


24 Nov, 2014

1 commit

  • Return a negative error code on failure.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

22 Nov, 2014

1 commit

  • Added a pci_dma_mapping_error() call to check for mapping errors before
    further using the dma handle. In case of error, control goes to a new label
    where the incoming skb is freed. Unchecked dma handles were found using
    Coccinelle:

    @rule1@
    expression e1;
    identifier x;
    @@

    *x = pci_map_single(...);
    ... when != pci_dma_mapping_error(e1,x)

    Signed-off-by: Tina Johnson
    Acked-by: Julia Lawall
    Signed-off-by: David S. Miller

    Tina Johnson
     

20 Oct, 2014

1 commit


17 Oct, 2014

1 commit


14 Aug, 2014

1 commit

  • Pull networking fixes from David Miller:
    "Several networking final fixes and tidies for the merge window:

    1) Changes during the merge window unintentionally took away the
    ability to build bluetooth modular, fix from Geert Uytterhoeven.

    2) Several phy_node reference count bug fixes from Uwe Kleine-König.

    3) Fix ucc_geth build failures, also from Uwe Kleine-König.

    4) Fix klog false positivies when netlink messages go to network
    taps, by properly resetting the network header. Fix from Daniel
    Borkmann.

    5) Sizing estimate of VF netlink messages is too small, from Jiri
    Benc.

    6) New APM X-Gene SoC ethernet driver, from Iyappan Subramanian.

    7) VLAN untagging is erroneously dependent upon whether the VLAN
    module is loaded or not, but there are generic dependencies that
    matter wrt what can be expected as the SKB enters the stack.
    Make the basic untagging generic code, and do it unconditionally.
    From Vlad Yasevich.

    8) xen-netfront only has so many slots in it's transmit queue so
    linearize packets that have too many frags. From Zoltan Kiss.

    9) Fix suspend/resume PHY handling in bcmgenet driver, from Florian
    Fainelli"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (55 commits)
    net: bcmgenet: correctly resume adapter from Wake-on-LAN
    net: bcmgenet: update UMAC_CMD only when link is detected
    net: bcmgenet: correctly suspend and resume PHY device
    net: bcmgenet: request and enable main clock earlier
    net: ethernet: myricom: myri10ge: myri10ge.c: Cleaning up missing null-terminate after strncpy call
    xen-netfront: Fix handling packets on compound pages with skb_linearize
    net: fec: Support phys probed from devicetree and fixed-link
    smsc: replace WARN_ON() with WARN_ON_SMP()
    xen-netback: Don't deschedule NAPI when carrier off
    net: ethernet: qlogic: qlcnic: Remove duplicate object file from Makefile
    wan: wanxl: Remove typedefs from struct names
    m68k/atari: EtherNEC - ethernet support (ne)
    net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call
    hdlc: Remove typedefs from struct names
    airo_cs: Remove typedef local_info_t
    atmel: Remove typedef atmel_priv_ioctl
    com20020_cs: Remove typedef com20020_dev_t
    ethernet: amd: Remove typedef local_info_t
    net: Always untag vlan-tagged traffic on input.
    drivers: net: Add APM X-Gene SoC ethernet driver support.
    ...

    Linus Torvalds
     

09 Aug, 2014

1 commit


08 Aug, 2014

2 commits

  • Convert a zero return value on error to a negative one, as returned
    elsewhere in the function.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Acked-by: Chas Williams
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Convert a zero return value on error to a negative one, as returned
    elsewhere in the function.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Acked-by: Chas Williams
    Signed-off-by: David S. Miller

    Julia Lawall
     

06 Aug, 2014

1 commit


03 Jun, 2014

1 commit


22 May, 2014

1 commit

  • Remove double checks, convert printk to pr_warn, and move the call to
    pr_warn to the first check. The simplified version of the coccinelle
    semantic patch that find this issue is as follows:

    //
    @@
    expression E; identifier pr; expression list es;
    @@
    while(...){
    ...
    - if (E) break;
    + if (E){
    + pr(es);
    + break;
    + }
    ...
    }
    - if(E) pr(es);
    //

    Tested by compilation only.

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: David S. Miller

    Peter Senna Tschudin
     

26 Mar, 2014

2 commits


28 Feb, 2014

1 commit

  • We are trying to finally kill off interruptible_sleep_on_timeout.
    the two uses in the nicstar driver can be trivially replaced
    with wait_event_interruptible_lock_irq_timeout, which prevents the
    wake-up race and is able to check the buffer state with scq->lock
    held.

    Signed-off-by: Arnd Bergmann
    Acked-by: Chas Williams
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

27 Feb, 2014

1 commit

  • interruptible_sleep_on is racy and going away. This replaces the one use
    in the firestream driver with the appropriate wait_event_interruptible
    variant.

    Signed-off-by: Arnd Bergmann
    Acked-by: Chas Williams
    Cc: linux-atm-general@lists.sourceforge.net
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

20 Feb, 2014

3 commits