diff options
author | Nicholas Piggin <[email protected]> | 2018-05-01 00:55:44 +1000 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2018-07-24 22:09:54 +1000 |
commit | bd90284cc6c1c9e8e48c8eadd0c79574fcce0b81 (patch) | |
tree | ac70869f8ae7993b873bc63c240f0147a774abca | |
parent | b29336c0e1785a28bc40a9fd47c2321671e9792e (diff) |
powerpc/powernv: opal_put_chars partial write fix
The intention here is to consume and discard the remaining buffer
upon error. This works if there has not been a previous partial write.
If there has been, then total_len is no longer total number of bytes
to copy. total_len is always "bytes left to copy", so it should be
added to written bytes.
This code may not be exercised any more if partial writes will not be
hit, but this is a small bugfix before a larger change.
Reviewed-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Nicholas Piggin <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
-rw-r--r-- | arch/powerpc/platforms/powernv/opal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 0d539c661748..371e33ecc547 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -388,7 +388,7 @@ int opal_put_chars(uint32_t vtermno, const char *data, int total_len) /* Closed or other error drop */ if (rc != OPAL_SUCCESS && rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT) { - written = total_len; + written += total_len; break; } if (rc == OPAL_SUCCESS) { |