01 Oct, 2016

2 commits


14 Sep, 2016

1 commit

  • Sometimes spidev_test crashes with:

    *** Error in `spidev_test': munmap_chunk(): invalid pointer: 0x00022020 ***
    Aborted

    or just

    Segmentation fault

    This is due to transfer_escaped_string() miscalculating the required
    size of the buffer by one byte, causing a buffer overflow in unescape().

    Drop the bogus "+ 1" in the strlen() parameter to fix this.

    Note that unescape() never copies the zero-terminator of the source
    string, so it writes at most as many bytes as the length of the source
    string.

    Fixes: 30061915be6e3a2c (spi: spidev_test: Added input buffer from the terminal)
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Mark Brown
    Cc: # v4.5+

    Geert Uytterhoeven
     

13 Sep, 2016

1 commit


15 Aug, 2016

1 commit

  • spidev.h uses _IOC_SIZEBITS directly. musl libc does not provide this macro
    unless linux/ioctl.h is included explicitly. Fixes build failures like:

    In file included from .../host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/sys/ioctl.h:7:0,
    from .../build/spidev_test-v3.15/spidev_test.c:20:
    .../build/spidev_test-v3.15/spidev_test.c: In function ‘transfer’:
    .../build/spidev_test-v3.15/spidev_test.c:75:18: error: ‘_IOC_SIZEBITS’ undeclared (first use in this function)
    ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
    ^

    Signed-off-by: Baruch Siach
    Signed-off-by: Mark Brown

    Baruch Siach
     

09 Dec, 2015

1 commit


30 Nov, 2015

1 commit


23 Nov, 2015

6 commits