staging: android: logger: Correct write offset reset on error
authorKarlis Ogsts <karlis.ogsts@sonymobile.com>
Mon, 22 Jul 2013 20:51:42 +0000 (13:51 -0700)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 22 Apr 2021 12:53:59 +0000 (14:53 +0200)
commitcb8c551e947495486ca6dba1b9400b39c471fefd
tree04e663e73fa92ec276f842776e571af0453c0138
parent7a875bcec75899e4c7dfdc4dc30eb46798917c1d
staging: android: logger: Correct write offset reset on error

In the situation that a writer fails to copy data from userspace it will reset
the write offset to the value it had before it went to sleep. This discarding
any messages written while aquiring the mutex.

Therefore the reset offset needs to be retrieved after acquiring the mutex.

Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/logger.c