]> git.ipfire.org Git - people/arne_f/kernel.git/commit
powerpc/powernv: opal_put_chars partial write fix
authorNicholas Piggin <npiggin@gmail.com>
Mon, 30 Apr 2018 14:55:44 +0000 (00:55 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:03 +0000 (08:38 +0200)
commitc7afa2064c06b9520f7e3931db7456a166989caf
tree9b4d07e31011d4151cb9dd8f443437b9c5df274f
parent737066efec608045559ce62abda4210962526349
powerpc/powernv: opal_put_chars partial write fix

[ Upstream commit bd90284cc6c1c9e8e48c8eadd0c79574fcce0b81 ]

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 <benh@kernel.crashing.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/powernv/opal.c