Skip to content

Commit

Permalink
staging:iio:kfifo remove entirely pointless code.
Browse files Browse the repository at this point in the history
I really don't want to think about how this bit got
in there.  It allocates some storage - copies something
into it then frees it without making use of it.
Oops.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent e69616b commit 4c3d153
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/staging/iio/kfifo_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,9 @@ static int iio_store_to_kfifo(struct iio_buffer *r,
{
int ret;
struct iio_kfifo *kf = iio_to_kfifo(r);
u8 *datal = kmalloc(r->bytes_per_datum, GFP_KERNEL);
memcpy(datal, data, r->bytes_per_datum - sizeof(timestamp));
memcpy(datal + r->bytes_per_datum - sizeof(timestamp),
&timestamp, sizeof(timestamp));
ret = kfifo_in(&kf->kf, data, r->bytes_per_datum);
if (ret != r->bytes_per_datum) {
kfree(datal);
if (ret != r->bytes_per_datum)
return -EBUSY;
}
kfree(datal);
return 0;
}

Expand Down

0 comments on commit 4c3d153

Please sign in to comment.