I think you may have misunderstood my last comment. These are OK:
struct mm_struct *mm = current->mm;
int unmapped_error = 0;
int error = -EINVAL;
This is not so good:
int error, unmapped_error;
This is the worst:
int error = -EINVAL, unmapped_error = 0;
So I think the original code is fine as it is.
Othewise patch looks OK now.
Miklos
--