summaryrefslogtreecommitdiffstats
path: root/.clang-format
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2018-07-01 19:32:05 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-25 14:35:12 +0200
commit2e3134caf63694bf1dbb2e68829871e14d543613 (patch)
tree55db564e291bf8ef073c902ae49fb2a05f408038 /.clang-format
parentmedia: tw686x: Fix oops on buffer alloc failure (diff)
downloadlinux-2e3134caf63694bf1dbb2e68829871e14d543613.tar.xz
linux-2e3134caf63694bf1dbb2e68829871e14d543613.zip
media: gspca_kinect: cast sizeof to int for comparison
Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. kinect_read returns the result of usb_control_msg, which can return a negtive error code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ int x; expression e,e1; identifier f; @@ *x = f(...); ... when != x = e1 when != if (x < 0 || ...) { ... return ...; } *x < sizeof(e) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions