]> git.baikalelectronics.ru Git - kernel.git/commit
[media] ascot2e: don't use variable length arrays
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 18:36:15 +0000 (15:36 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 18:41:27 +0000 (15:41 -0300)
commitf6c8741244cf2f518b5126b4f99c872ffecf84e1
tree8d4fb08159c3ad854804a2c4e08ed594b4c2ca7a
parent43040bad571009e883d49a47c6c43aeb0abe2c24
[media] ascot2e: don't use variable length arrays

The Linux stack is short; we need to be able to count the number
of bytes used at stack on each function. So, we don't like to
use variable-length arrays, as complained by smatch:
        drivers/media/dvb-frontends/horus3a.c:57:19: warning: Variable length array is used.

The max usecase of the driver seems to be 10 bytes + 1 for the
register.

So, let's be safe and allocate 11 bytes for the write buffer.
This should be enough to cover all cases. If not, let's print
an error message.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/ascot2e.c