]> git.baikalelectronics.ru Git - kernel.git/commit
[media] cxd2841er: don't use variable length arrays
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 18:22:36 +0000 (15:22 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 18:37:10 +0000 (15:37 -0300)
commitb2005a858352c33ae55371e8d2a6d85b10c22c08
tree5b54568be680da6a6b5394e15991aefc3e67f80f
parent835320408f64936b3aa2278a6645adbd0d1fe9f6
[media] cxd2841er: 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/cxd2841er.c:205:19: warning: Variable length array is used.

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

So, let's be safe and allocate 17 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/cxd2841er.c