From nobody Sun Dec 22 03:50:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YG6dB2CdMz5hy7Y; Sun, 22 Dec 2024 03:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6dB1Hs2z4Gys; Sun, 22 Dec 2024 03:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4PslL2UVBUB/wpynJxKOuStBi7RKqKLBpfItUj1JyDs=; b=G7FPKb/dKMHpyTMpeRzwdC8ptTtmANkMmCEwryqgVFL432SjoYXRXJYe0XI5/bJ2qTB/qa p1OwZfUajMfb6rI9xAGpY4vq6ohh3WapXAcLtCu/20BewBBIczoefLbNqeVUZiAPFOL1gX 2sMXt2IFTTs5egEZKwOFVLWGWOyDbWBSLmb9P2tcNxzDehQA3NUCxF98Tv509X7lLOymFH sSEvbvfaT2LwZfYKTCNRgd4nKSU5pe3DC+vYkG1FE6EZRkhRV5L14yPGPMPoAMAfZi2lTf n1zYIPUbCl4EHPpK4s4jasbmGFPoVEekzIKKuNsxnLcMdjOtCQhKPXD+zRTQDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4PslL2UVBUB/wpynJxKOuStBi7RKqKLBpfItUj1JyDs=; b=XOvJuHt6a2Xx4gt7X7ibjXoP+h0e9Pww4mADt+leeGzOISyeqDBzH0r4IioQFG4HZdxtBS JUsESIVgu6RbXdmaeXEVMD2RWV+vi44cXuG8foIMDajbrwTLi+ne+eEFzI8wF56pOdNaRX 0kfONbJNgevsmNv5EPqtSp7WWeVm9IfXxSf2w+9UWyj6quX15jVnQu6P6X+rm9hCHbMbh9 dz7epZV95V4JJpBPxqOFXJA8AD50VDxLFI90/pXWiCa3UTWH7DigU4n221++dpnmk+xJdv GCxXv9lKc7h/iIX5qYXW9ELzq2eDCCk7+Sq3sY/Le+MPMJlYZXdEKx09j+uQ7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734839454; a=rsa-sha256; cv=none; b=Xm/8F7wGGiihUQxqkjCQvjisIf7nCITw7HUvI4aXHVhQeb49EiznezDZW10jnUQen7BVY4 Ov9MwSGq/IPf+awFsrAiCAFEDiKqV6gBL6BgcE9pU84uAVblG8VJBVkZvglKFUlHc/TEO+ 29mI4TKy2xRexaS+/bYfBr3dg0wkqw8n9qfeQ0++SY2s4U3415jhBES27sln/XYqKH/A7u LgJrPfSabHGDe099KGapCoswbuUSoHoG9z4+K5zFSRL2kZLOhNuMAW/uJ+U44+VRZyQMiP Atl0+3mcB52i8I6ZXJqhx7Ce04rXnGow/Fnpy8M0iZJ5asGfgaZGK6NPkXAGfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YG6dB0vNHzsWR; Sun, 22 Dec 2024 03:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3osgx081941; Sun, 22 Dec 2024 03:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3osGf081938; Sun, 22 Dec 2024 03:50:54 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:50:54 GMT Message-Id: <202412220350.4BM3osGf081938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: ca6cd0e57cca - stable/13 - hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca6cd0e57cca4a39a2947c35b9e5f0ef11979fb5 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ca6cd0e57cca4a39a2947c35b9e5f0ef11979fb5 commit ca6cd0e57cca4a39a2947c35b9e5f0ef11979fb5 Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:25:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:49:07 +0000 hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl HIDRAW_GET_REPORT ioctl is documented to update hgd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week (cherry picked from commit f4f46a2eef3be6d19c65a4ca4ee70f365dd5be4f) --- sys/dev/hid/hidraw.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index 703e16d8bf8f..bd5f99bd4eba 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -570,6 +570,7 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct hidraw_devinfo *hd; const char *devname; uint32_t size; + hid_size_t actsize; int id, len; int error = 0; @@ -748,16 +749,16 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, } size = MIN(hgd->hgd_maxlen, size); buf = HIDRAW_LOCAL_ALLOC(local_buf, size); - error = hid_get_report(sc->sc_dev, buf, size, NULL, + actsize = 0; + error = hid_get_report(sc->sc_dev, buf, size, &actsize, hgd->hgd_report_type, id); if (!error) - error = copyout(buf, hgd->hgd_data, size); + error = copyout(buf, hgd->hgd_data, actsize); HIDRAW_LOCAL_FREE(local_buf, buf); + hgd->hgd_actlen = actsize; #ifdef COMPAT_FREEBSD32 - /* - * HIDRAW_GET_REPORT is declared _IOWR, but hgd is not written - * so we don't call update_hgd32(). - */ + if (hgd32 != NULL) + update_hgd32(hgd, hgd32); #endif return (error);