kernel_optimize_test/net/9p
Vincent Bernat 999b8b88c6 9p: ensure err is initialized to 0 in p9_client_read/write
Some use of those functions were providing unitialized values to those
functions. Notably, when reading 0 bytes from an empty file on a 9P
filesystem, the return code of read() was not 0.

Tested with this simple program:

    #include <assert.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <unistd.h>

    int main(int argc, const char **argv)
    {
        assert(argc == 2);
        char buffer[256];
        int fd = open(argv[1], O_RDONLY|O_NOCTTY);
        assert(fd >= 0);
        assert(read(fd, buffer, 0) == 0);
        return 0;
    }

Cc: stable@vger.kernel.org # v4.1
Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-08-22 21:35:02 -04:00
..
client.c 9p: ensure err is initialized to 0 in p9_client_read/write 2015-08-22 21:35:02 -04:00
error.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
Kconfig
Makefile
mod.c
protocol.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
protocol.h
trans_common.c net/9p: remove (now-)unused helpers 2015-04-11 22:28:29 -04:00
trans_common.h net/9p: remove (now-)unused helpers 2015-04-11 22:28:29 -04:00
trans_fd.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
trans_rdma.c IB/core: Change ib_create_cq to use struct ib_cq_init_attr 2015-06-12 14:49:10 -04:00
trans_virtio.c 9p/trans_virtio: reset virtio device on remove 2015-07-13 19:47:10 +03:00
util.c