summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/go7007
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2015-09-17 01:55:04 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-10-01 13:32:52 +0200
commit5bcc0dd7906758ad9b37ce66835e5b53e15d9b1d (patch)
tree6bd7290d00bc7852e0697b980726d91aa199bbca /drivers/media/usb/go7007
parent[media] s5c73m3: Export OF module alias information (diff)
downloadlinux-5bcc0dd7906758ad9b37ce66835e5b53e15d9b1d.tar.xz
linux-5bcc0dd7906758ad9b37ce66835e5b53e15d9b1d.zip
[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>
Diffstat (limited to 'drivers/media/usb/go7007')
-rw-r--r--drivers/media/usb/go7007/go7007-fw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/usb/go7007/go7007-fw.c b/drivers/media/usb/go7007/go7007-fw.c
index 5f4c9b9e899a..60bf5f0644d1 100644
--- a/drivers/media/usb/go7007/go7007-fw.c
+++ b/drivers/media/usb/go7007/go7007-fw.c
@@ -379,7 +379,7 @@ static int gen_mjpeghdr_to_package(struct go7007 *go, __le16 *code, int space)
buf = kzalloc(4096, GFP_KERNEL);
if (buf == NULL)
- return -1;
+ return -ENOMEM;
for (i = 1; i < 32; ++i) {
mjpeg_frame_header(go, buf + size, i);
@@ -646,7 +646,7 @@ static int gen_mpeg1hdr_to_package(struct go7007 *go,
buf = kzalloc(5120, GFP_KERNEL);
if (buf == NULL)
- return -1;
+ return -ENOMEM;
framelen[0] = mpeg1_frame_header(go, buf, 0, 1, PFRAME);
if (go->interlace_coding)
@@ -832,7 +832,7 @@ static int gen_mpeg4hdr_to_package(struct go7007 *go,
buf = kzalloc(5120, GFP_KERNEL);
if (buf == NULL)
- return -1;
+ return -ENOMEM;
framelen[0] = mpeg4_frame_header(go, buf, 0, PFRAME);
i = 368;