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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2013 08:50:51 +0000 (16:50 +0800)
commitdbc31d4e7958e7539180b9f2d7c8446e4a0429d4
tree4a297552790ab280b8f75241ae1634e01fb0a9a3
parent867ea7111553d42d7a1545d1c69998a1a53b3166
staging: android: logger: Correct write offset reset on error

commit 72bb99cfe9c57d2044445fb34bbc95b4c0bae6f2 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/logger.c