X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2Fkfifo.c;h=d79b9d222065bd9467e4e091ad850a2ce4d93c94;hb=794e96e8ecc1eeff56f4ede168fd0b8f4c5a00b9;hp=7b7f83027b7b748a4a1497d7804d4b54077d0790;hpb=7fb476c231bbc551ede5b4afb189d9ca5ab7406d;p=firefly-linux-kernel-4.4.55.git diff --git a/lib/kfifo.c b/lib/kfifo.c index 7b7f83027b7b..d79b9d222065 100644 --- a/lib/kfifo.c +++ b/lib/kfifo.c @@ -215,7 +215,7 @@ static unsigned long kfifo_copy_from_user(struct __kfifo *fifo, * 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(struct __kfifo *fifo, void __user *to, * 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; }