Skip to contentSkip to conversation

kfifo-kfifo_copy_tofrom_user-fix-copied-bytes-calculation.patch removed from -mm tree

merged [email protected] 1 participant 1 message Nov 15, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] kfifo-kfifo_copy_tofrom_user-fix-copied-bytes-calculation.patch removed from -mm tree
To: [email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 15 Nov 2013 12:09:29 -0800

The patch titled
Subject: kfifo: kfifo_copy_{to,from}_user: fix copied bytes calculation
has been removed from the -mm tree. Its filename was
kfifo-kfifo_copy_tofrom_user-fix-copied-bytes-calculation.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Lars-Peter Clausen <[email protected]>
Subject: kfifo: kfifo_copy_{to,from}_user: fix copied bytes calculation

'copied' and 'len' are in bytes, while 'ret' is in elements, so we need to multiply 'ret' with the size of one element to get the correct result.

---

 lib/kfifo.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/kfifo.c renamed from lib/kfifo.c~kfifo-kfifo_copy_tofrom_user-fix-copied-bytes-calculation +2 -2
diff -puN lib/kfifo.c~kfifo-kfifo_copy_tofrom_user-fix-copied-bytes-calculation lib/kfifo.c
@@ -215,7 +215,7 @@ static unsigned long kfifo_copy_from_use
 	 * incrementing the fifo->in index counter
 	 */
 	smp_wmb();
-	*copied = len - ret;
+	*copied = len - ret * esize;
 	/* return the number of elements which are not copied */
 	return ret;
 }
@@ -275,7 +275,7 @@ static unsigned long kfifo_copy_to_user(
 	 * incrementing the fifo->out index counter
 	 */
 	smp_wmb();
-	*copied = len - ret;
+	*copied = len - ret * esize;
 	/* return the number of elements which are not copied */
 	return ret;
 }

_

Patches currently in -mm which might be from [email protected] are

origin.patch
linux-next.patch