aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kfifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kfifo.c')
-rw-r--r--kernel/kfifo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 32c5c15d750d..35edbe22e9a9 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask)
80 80
81 buffer = kmalloc(size, gfp_mask); 81 buffer = kmalloc(size, gfp_mask);
82 if (!buffer) { 82 if (!buffer) {
83 _kfifo_init(fifo, 0, 0); 83 _kfifo_init(fifo, NULL, 0);
84 return -ENOMEM; 84 return -ENOMEM;
85 } 85 }
86 86
@@ -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
@@ -349,6 +350,7 @@ EXPORT_SYMBOL(__kfifo_from_user_n);
349 * @fifo: the fifo to be used. 350 * @fifo: the fifo to be used.
350 * @from: pointer to the data to be added. 351 * @from: pointer to the data to be added.
351 * @len: the length of the data to be added. 352 * @len: the length of the data to be added.
353 * @total: the actual returned data length.
352 * 354 *
353 * This function copies at most @len bytes from the @from into the 355 * This function copies at most @len bytes from the @from into the
354 * FIFO depending and returns -EFAULT/0. 356 * FIFO depending and returns -EFAULT/0.
@@ -399,7 +401,7 @@ EXPORT_SYMBOL(__kfifo_to_user_n);
399 * @fifo: the fifo to be used. 401 * @fifo: the fifo to be used.
400 * @to: where the data must be copied. 402 * @to: where the data must be copied.
401 * @len: the size of the destination buffer. 403 * @len: the size of the destination buffer.
402 @ @lenout: pointer to output variable with copied data 404 * @lenout: pointer to output variable with copied data
403 * 405 *
404 * This function copies at most @len bytes from the FIFO into the 406 * This function copies at most @len bytes from the FIFO into the
405 * @to buffer and 0 or -EFAULT. 407 * @to buffer and 0 or -EFAULT.