06 Dec, 2016

2 commits

  • It returns variable "error" when ioremap_nocache() returns a NULL
    pointer. The value of "error" is 0 then, which will mislead the callers
    to believe that there is no error. This patch fixes the bug, returning
    "-ENOMEM".

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189021

    Signed-off-by: Pan Bian
    Signed-off-by: David S. Miller

    Pan Bian
     
  • In function lanai_dev_open(), when the call to ioremap() fails, the
    value of return variable result is 0. 0 means no error in this context.
    This patch fixes the bug, assigning "-ENOMEM" to result when ioremap()
    returns a NULL pointer.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188791

    Signed-off-by: Pan Bian
    Signed-off-by: David S. Miller

    Pan Bian
     

16 Sep, 2016

1 commit


11 Sep, 2016

9 commits

  • Adjust the indentation for a call of the macro "DPRINTK" in this function.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • * The script "checkpatch.pl" can point information out like the following.

    WARNING: Prefer kcalloc over kzalloc with multiply

    Thus fix the affected source code place.

    * Replace the specification of a data type by a pointer dereference
    to make the corresponding size determination a bit safer according to
    the Linux coding style convention.

    * Delete the local variable "size" which became unnecessary with
    this refactoring.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • Replace the specification of a data structure by a pointer dereference
    as the parameter for the operator "sizeof" to make the corresponding size
    determination a bit safer according to the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • * A multiplication for the size determination of a memory allocation
    indicated that an array data structure should be processed.
    Thus use the corresponding function "kmalloc_array".

    This issue was detected by using the Coccinelle software.

    * Replace the specification of a data type by a pointer dereference
    to make the corresponding size determination a bit safer according to
    the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • The script "checkpatch.pl" can point out that assignments should usually
    not be performed within condition checks.
    Thus move an assignment for a local variable to a separate statement
    in this function.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • * The script "checkpatch.pl" can point out that assignments should usually
    not be performed within condition checks.
    Thus move an assignment for a local variable to a separate statement
    in this function.

    * Replace the specification of a data structure by a pointer dereference
    as the parameter for the operator "sizeof" to make the corresponding size
    determination a bit safer according to the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • Replace the specification of a data structure by a reference for a field
    in a local variable as the parameter for the operator "sizeof" to make
    the corresponding size determination a bit safer according to
    the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • Replace the specification of a data structure by a pointer dereference
    as the parameter for the operator "sizeof" to make the corresponding size
    determination a bit safer according to the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • * A multiplication for the size determination of a memory allocation
    indicated that an array data structure should be processed.
    Thus use the corresponding function "kmalloc_array".

    This issue was detected by using the Coccinelle software.

    * Replace the specification of a data type by a pointer dereference
    to make the corresponding size determination a bit safer according to
    the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     

10 Sep, 2016

3 commits

  • * Multiplications for the size determination of memory allocations
    indicated that array data structures should be processed.
    Thus use the corresponding function "kmalloc_array".

    This issue was detected by using the Coccinelle software.

    * Replace the specification of data types by pointer dereferences
    to make the corresponding size determination a bit safer according to
    the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • * Multiplications for the size determination of memory allocations
    indicated that array data structures should be processed.
    Thus use the corresponding function "kmalloc_array".

    This issue was detected by using the Coccinelle software.

    * Replace the specification of data types by pointer dereferences
    to make the corresponding size determination a bit safer according to
    the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • * A multiplication for the size determination of a memory allocation
    indicated that an array data structure should be processed.
    Thus use the corresponding function "kmalloc_array".

    This issue was detected by using the Coccinelle software.

    * Replace the specification of a data structure by a pointer dereference
    to make the corresponding size determination a bit safer according to
    the Linux coding style convention.

    Signed-off-by: Markus Elfring
    Signed-off-by: David S. Miller

    Markus Elfring
     

19 Aug, 2016

1 commit


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