mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 02:05:31 +07:00
staging:iio:kfifo remove entirely pointless code.
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>
This commit is contained in:
parent
e69616b1e6
commit
4c3d15358a
@ -150,16 +150,9 @@ static int iio_store_to_kfifo(struct iio_buffer *r,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct iio_kfifo *kf = iio_to_kfifo(r);
|
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),
|
|
||||||
×tamp, sizeof(timestamp));
|
|
||||||
ret = kfifo_in(&kf->kf, data, r->bytes_per_datum);
|
ret = kfifo_in(&kf->kf, data, r->bytes_per_datum);
|
||||||
if (ret != r->bytes_per_datum) {
|
if (ret != r->bytes_per_datum)
|
||||||
kfree(datal);
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
|
||||||
kfree(datal);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user