From: Dan Carpenter Date: Thu, 8 Jan 2015 10:07:08 +0000 (-0300) Subject: [media] coda: improve safety in coda_register_device() X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~131^2~202 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88ca3af44beb281979e3f037d167cc3fec68c9de;p=pandora-kernel.git [media] coda: improve safety in coda_register_device() The "i" variable is used as an offset into both the dev->vfd[] and the dev->devtype->vdevs[] arrays. The second array is smaller so we should use that as a limit instead of ARRAY_SIZE(dev->vfd). Also the original check was off by one. We should use a format string as well in case the ->name has any funny characters and also to stop static checkers from complaining. Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed