kfifo: Make kfifo_initialized work after kfifo_free
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Wed, 27 Jan 2010 14:09:34 +0000 (17:09 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Feb 2010 23:11:06 +0000 (15:11 -0800)
commit1a02d59aba9b61b820517fb135086471c065b573
tree349a6c71a67036b415ae48aaf1a61331244afde7
parent1ebca9dad5abe8b2ed4dbd186cd657fb47c1f321
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>
kernel/kfifo.c