diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-05-20 17:40:35 -0700 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-06-11 03:30:21 -0700 |
commit | 2971a5bac8cab3cb56f19e9c494ecb3b120c5199 (patch) | |
tree | aa01c08f44f337304984fac35d60cd940c112a45 /lib/smp_processor_id.c | |
parent | c56affafdd29eb9764b0e35e3434cc06f6bc3781 (diff) |
wimax/i2400m: fix panic due to missed corner cases on tail_room calculation
i2400m_tx_skip_tail() needs to handle the special case of being called
when the tail room that is left over in the FIFO is zero.
This happens when a TX message header was opened at the very end of
the FIFO (without payloads). The i2400m_tx_close() code already marked
said TX message (header) to be skipped and this function should be
doing nothing.
It is called anyway because it is part of a common "corner case" path
handling which takes care of more cases than only this one.
The tail room computation was also improved to take care of the case
when tx_in is at the end of the buffer boundary; tail_room has to be
modded (%) to the buffer size. To do that in a single well-documented
place, __i2400m_tx_tail_room() is introduced and used.
Treat i2400m->tx_in == 0 as a corner case and handle it accordingly.
Found and diagnosed by Cindy H. Kao.
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'lib/smp_processor_id.c')
0 files changed, 0 insertions, 0 deletions