aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kfifo.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2010-01-27 09:09:34 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-02-16 18:11:06 -0500
commit1a02d59aba9b61b820517fb135086471c065b573 (patch)
tree349a6c71a67036b415ae48aaf1a61331244afde7 /kernel/kfifo.c
parent1ebca9dad5abe8b2ed4dbd186cd657fb47c1f321 (diff)
kfifo: Make kfifo_initialized work after kfifo_free
After kfifo rework it's no longer possible to reliably know if kfifo is usable, since after kfifo_free(), kfifo_initialized() would still return true. The correct behaviour is needed for at least FHCI USB driver. This patch fixes the issue by resetting the kfifo to zero values (the same approach is used in kfifo_alloc() if allocation failed). Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/kfifo.c')
-rw-r--r--kernel/kfifo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 498cabba225e..559fb5582b60 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -97,6 +97,7 @@ EXPORT_SYMBOL(kfifo_alloc);
97void kfifo_free(struct kfifo *fifo) 97void kfifo_free(struct kfifo *fifo)
98{ 98{
99 kfree(fifo->buffer); 99 kfree(fifo->buffer);
100 _kfifo_init(fifo, NULL, 0);
100} 101}
101EXPORT_SYMBOL(kfifo_free); 102EXPORT_SYMBOL(kfifo_free);
102 103