pipe: fix failure to return error code on ->confirm()
authorNicolas Kaiser <nikai@nikai.net>
Thu, 21 Oct 2010 12:56:00 +0000 (14:56 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Thu, 21 Oct 2010 12:56:33 +0000 (14:56 +0200)
The arguments were transposed, we want to assign the error code to
'ret', which is being returned.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
fs/pipe.c

index 279eef96c51cdf28a81d4f0c3d0d702a71dc5a1c..37eb1ebeaa906ea068f940e6298f8cd632feacb4 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -382,7 +382,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
                        error = ops->confirm(pipe, buf);
                        if (error) {
                                if (!ret)
-                                       error = ret;
+                                       ret = error;
                                break;
                        }