Commit cf55902
staging: android: ion: Fix error handling in ion_query_heaps()
If the copy_to_user() fails we should unlock and return directly without
updating "cnt". Also the return value should be -EFAULT instead of the
number of bytes remaining.
Fixes: 02b2380 ("staging: android: ion: Add ioctl to query available heaps")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 8b77eb9 commit cf55902
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | | - | |
1191 | | - | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1192 | 1194 | | |
1193 | 1195 | | |
1194 | 1196 | | |
| |||
0 commit comments