All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] Bug in a4l_get_chan
@ 2010-03-26 14:08 Daniele Nicolodi
  2010-03-28 23:35 ` Alexis Berlemont
  0 siblings, 1 reply; 3+ messages in thread
From: Daniele Nicolodi @ 2010-03-26 14:08 UTC (permalink / raw)
  To: xenomai-core, Alexis Berlemont

Hello Alexis,

I found that a4l_get_chan() in buffer.c does not work for subdevices
that use a global channels description struct (mode =
A4L_CHAN_GLOBAL_CHANDESC in the a4l_chdesc_t structure).

The problem is that a4l_get_chan() iterates (twice) on the chan_desc
array looking for channel descriptions at indexes higher than 0, also in
the case where those are not populated because the subdevice uses a
single channel description structure for all channels.

This bug is quite bas, as it triggers a kernel oops for a integer
division by zero when an a4l_cmd_t command is issued with a channels
description array that does not have the channel id 0 as first acquired
channel. You can easily reproduce the bug using the ni_pcimio driver,
using cmd_read with the parameter -c 1.

I'm looking into providing a patch, but I have some difficulties in
understanding the rational of this part of analogy code...

Cheers,
-- 
Daniele


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-29 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 14:08 [Xenomai-core] Bug in a4l_get_chan Daniele Nicolodi
2010-03-28 23:35 ` Alexis Berlemont
2010-03-29 16:48   ` Daniele Nicolodi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.