]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
hid: Handle errors from copyin() in ioctl handlers
authorMark Johnston <markj@FreeBSD.org>
Tue, 26 Dec 2023 01:37:49 +0000 (20:37 -0500)
committerMark Johnston <markj@FreeBSD.org>
Tue, 2 Jan 2024 01:12:44 +0000 (20:12 -0500)
commit7db5449ec5b176036b28c9b91a91ea2d09f37566
tree6513f4fdd19fb52d38a025e49790b8d96214cac4
parent573b117f6e30b8839bec4a778c37d60d88d980f5
hid: Handle errors from copyin() in ioctl handlers

If copyin() fails, the driver will proceed blindly with a zeroed buffer,
which is not what we want.  In preparation for annotating copyin() with
__result_use_check, start checking for errors.

Reviewed by: wulf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43102

(cherry picked from commit e452fa70d50761b5fe5f19c3c93c107be116728c)
sys/dev/hid/hidraw.c