Commit 4c76f33
committed
media: v4l2-ctrls-api: fix error handling for v4l2_g_ctrl()
As detected by Coverity, the error check logic at get_ctrl() is
broken: if ptr_to_user() fails to fill a control due to an error,
no errors are returned and v4l2_g_ctrl() returns success on a
failed operation, which may cause applications to fail.
Add an error check at get_ctrl() and ensure that it will
be returned to userspace without filling the control value if
get_ctrl() fails.
Fixes: 71c689d ("media: v4l2-ctrls: split up into four source files")
Cc: [email protected]
Signed-off-by: Mauro Carvalho Chehab <[email protected]>1 parent fa88dc7 commit 4c76f33
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
| 757 | + | |
757 | 758 | | |
758 | | - | |
| 759 | + | |
759 | 760 | | |
760 | 761 | | |
761 | 762 | | |
| |||
770 | 771 | | |
771 | 772 | | |
772 | 773 | | |
773 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
774 | 778 | | |
775 | 779 | | |
776 | 780 | | |
| |||
811 | 815 | | |
812 | 816 | | |
813 | 817 | | |
814 | | - | |
815 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
816 | 821 | | |
817 | | - | |
| 822 | + | |
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
| |||
0 commit comments