From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-usb@vger.kernel.org, Stefani Seibold <stefani@seibold.net>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: [PATCH 1/3] kfifo: Make kfifo_initialized work after kfifo_free
Date: Wed, 27 Jan 2010 17:09:34 +0300 [thread overview]
Message-ID: <20100127140934.GA31608@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100127140809.GA27906@oksana.dev.rtsoft.ru>
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>
---
kernel/kfifo.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 32c5c15..3b00bf8 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -97,6 +97,7 @@ EXPORT_SYMBOL(kfifo_alloc);
void kfifo_free(struct kfifo *fifo)
{
kfree(fifo->buffer);
+ _kfifo_init(fifo, NULL, 0);
}
EXPORT_SYMBOL(kfifo_free);
--
1.6.5.7
WARNING: multiple messages have this Message-ID (diff)
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Josh Boyer <jwboyer@gmail.com>,
Stefani Seibold <stefani@seibold.net>,
linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: [PATCH 1/3] kfifo: Make kfifo_initialized work after kfifo_free
Date: Wed, 27 Jan 2010 17:09:34 +0300 [thread overview]
Message-ID: <20100127140934.GA31608@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100127140809.GA27906@oksana.dev.rtsoft.ru>
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>
---
kernel/kfifo.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 32c5c15..3b00bf8 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -97,6 +97,7 @@ EXPORT_SYMBOL(kfifo_alloc);
void kfifo_free(struct kfifo *fifo)
{
kfree(fifo->buffer);
+ _kfifo_init(fifo, NULL, 0);
}
EXPORT_SYMBOL(kfifo_free);
--
1.6.5.7
next prev parent reply other threads:[~2010-01-27 14:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 14:08 [PATCH 0/3 for 2.6.33] Some fixes for kfifo and FHCI Anton Vorontsov
2010-01-27 14:08 ` Anton Vorontsov
2010-01-27 14:09 ` Anton Vorontsov [this message]
2010-01-27 14:09 ` [PATCH 1/3] kfifo: Make kfifo_initialized work after kfifo_free Anton Vorontsov
2010-01-27 14:09 ` [PATCH 2/3] USB: FHCI: Fix build after kfifo rework Anton Vorontsov
2010-01-27 14:09 ` Anton Vorontsov
2010-01-27 14:09 ` [PATCH 3/3] kfifo: Don't use integer as NULL pointer Anton Vorontsov
2010-01-27 14:09 ` Anton Vorontsov
2010-01-27 14:50 ` [PATCH 0/3 for 2.6.33] Some fixes for kfifo and FHCI Greg KH
2010-01-27 14:50 ` Greg KH
2010-01-27 15:47 ` Stefani Seibold
2010-01-27 15:47 ` Stefani Seibold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100127140934.GA31608@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=stefani@seibold.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.