tty/vt: consolemap: check put_user() in con_get_unimap()
Only the return value of copy_to_user() is checked in con_get_unimap(). Do the same for put_user() of the count too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220607104946.18710-16-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cb47d81f0f
commit
949fafcd7f
@ -813,7 +813,8 @@ unlock:
|
|||||||
console_unlock();
|
console_unlock();
|
||||||
if (copy_to_user(list, unilist, min(ect, ct) * sizeof(*unilist)))
|
if (copy_to_user(list, unilist, min(ect, ct) * sizeof(*unilist)))
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
put_user(ect, uct);
|
if (put_user(ect, uct))
|
||||||
|
ret = -EFAULT;
|
||||||
kvfree(unilist);
|
kvfree(unilist);
|
||||||
return ret ? ret : (ect <= ct) ? 0 : -ENOMEM;
|
return ret ? ret : (ect <= ct) ? 0 : -ENOMEM;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user