[media] go7007: Fix returned errno code in gen_mjpeghdr_to_package()
authorJavier Martinez Canillas <javier@osg.samsung.com>
Wed, 16 Sep 2015 23:55:04 +0000 (20:55 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 1 Oct 2015 11:32:52 +0000 (08:32 -0300)
commit5bcc0dd7906758ad9b37ce66835e5b53e15d9b1d
tree6bd7290d00bc7852e0697b980726d91aa199bbca
parent5aa2ccfc370f0a48f16492059a95a1252d721f6c
[media] go7007: Fix returned errno code in gen_mjpeghdr_to_package()

The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed. Since the error number is propagated,
the caller will get a -EPERM which is the wrong error condition.

Also, the smatch tool complains with the following warning:

gen_mjpeghdr_to_package() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/go7007/go7007-fw.c