diff options
Diffstat (limited to 'include/linux/regset.h')
-rw-r--r-- | include/linux/regset.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/regset.h b/include/linux/regset.h index 8abee6556223..686f37327a49 100644 --- a/include/linux/regset.h +++ b/include/linux/regset.h | |||
@@ -335,8 +335,11 @@ static inline int copy_regset_to_user(struct task_struct *target, | |||
335 | { | 335 | { |
336 | const struct user_regset *regset = &view->regsets[setno]; | 336 | const struct user_regset *regset = &view->regsets[setno]; |
337 | 337 | ||
338 | if (!regset->get) | ||
339 | return -EOPNOTSUPP; | ||
340 | |||
338 | if (!access_ok(VERIFY_WRITE, data, size)) | 341 | if (!access_ok(VERIFY_WRITE, data, size)) |
339 | return -EIO; | 342 | return -EFAULT; |
340 | 343 | ||
341 | return regset->get(target, regset, offset, size, NULL, data); | 344 | return regset->get(target, regset, offset, size, NULL, data); |
342 | } | 345 | } |
@@ -358,8 +361,11 @@ static inline int copy_regset_from_user(struct task_struct *target, | |||
358 | { | 361 | { |
359 | const struct user_regset *regset = &view->regsets[setno]; | 362 | const struct user_regset *regset = &view->regsets[setno]; |
360 | 363 | ||
364 | if (!regset->set) | ||
365 | return -EOPNOTSUPP; | ||
366 | |||
361 | if (!access_ok(VERIFY_READ, data, size)) | 367 | if (!access_ok(VERIFY_READ, data, size)) |
362 | return -EIO; | 368 | return -EFAULT; |
363 | 369 | ||
364 | return regset->set(target, regset, offset, size, NULL, data); | 370 | return regset->set(target, regset, offset, size, NULL, data); |
365 | } | 371 | } |