summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorCyril Roelandt <tipecaml@gmail.com>2012-11-16 18:17:01 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-26 10:04:46 -0200
commitcb412a8da82233af001d13c28fc54f25a2001aef (patch)
tree8b6d6f8f985ae3aa2bfb7d39e938f2bf45f3b57f /drivers/staging
parent899a179dbf5878fd01c0bd3b0e884ec526916afb (diff)
downloadblackbird-op-linux-cb412a8da82233af001d13c28fc54f25a2001aef.tar.gz
blackbird-op-linux-cb412a8da82233af001d13c28fc54f25a2001aef.zip
[media] staging/media/solo6x10/v4l2-enc.c: fix error-handling
The return values of copy_to_user() and copy_from_user() cannot be negative. Found using the following semantich patch: <spml> @exists@ identifier ret; statement S; expression E; @@ ( * ret = copy_to_user(...); | * ret = copy_from_user(...); ) ... when != ret = E when != if (ret) { <+... ret = E; ...+> } * if (ret < 0) S </spml> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/solo6x10/v4l2-enc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/media/solo6x10/v4l2-enc.c b/drivers/staging/media/solo6x10/v4l2-enc.c
index f8f0da952288..4977e869d5b7 100644
--- a/drivers/staging/media/solo6x10/v4l2-enc.c
+++ b/drivers/staging/media/solo6x10/v4l2-enc.c
@@ -1619,6 +1619,8 @@ static int solo_s_ext_ctrls(struct file *file, void *priv,
solo_enc->osd_text[OSD_TEXT_MAX] = '\0';
if (!err)
err = solo_osd_print(solo_enc);
+ else
+ err = -EFAULT;
}
break;
default:
@@ -1654,6 +1656,8 @@ static int solo_g_ext_ctrls(struct file *file, void *priv,
err = copy_to_user(ctrl->string,
solo_enc->osd_text,
OSD_TEXT_MAX);
+ if (err)
+ err = -EFAULT;
}
break;
default:
OpenPOWER on IntegriCloud