diff options
author | James Hogan <james.hogan@imgtec.com> | 2012-02-15 11:24:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-08 10:39:53 -0300 |
commit | df1caa587aa526f73d07abf85ebab88d0fd754ec (patch) | |
tree | d25d683fddd670b5105a5d1debe76ce46f5ec707 /drivers/edac/edac_mc.c | |
parent | 750a6dff6e81fac5ef95d054a6a907debcef9fde (diff) |
[media] rc/ir-raw: use kfifo_rec_ptr_1 instead of kfifo
Raw IR events are passed to the raw event thread through a kfifo. The
size of the event struct is 12 bytes, and space for 512 events is
reserved in the kfifo (6144 bytes), however this is rounded down to 4096
bytes (the next power of 2) by __kfifo_alloc().
4096 bytes is not divisible by 12 therefore if the fifo fills up a third
of a record will be written in the end of the kfifo by
ir_raw_event_store() because the recsize of the fifo is 0 (it doesn't
have records). When this is read by ir_raw_event_thread() a corrupted or
partial record will be read, and in the case of a partial record the
BUG_ON(retval != sizeof(ev)) gets hit too.
According to samples/kfifo/record-example.c struct kfifo_rec_ptr_1 can
handle records of a length between 0 and 255 bytes, so change struct
ir_raw_event_ctrl to use that instead of struct kfifo.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/edac_mc.c')
0 files changed, 0 insertions, 0 deletions