From nobody Sun Dec 22 03:37:50 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 4YG6L63W8Zz5hwqd; Sun, 22 Dec 2024 03:37:50 +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 4YG6L62nfwz4DMm; Sun, 22 Dec 2024 03:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838670; 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=q9DRZt2VKZEQ0CmFGhJZN82IETtJr0DVNUbwrJ+wpPw=; b=Rij7E3Z2xA0vy9Hr4slMBW8+c7JcPnSAhTwNsYbhJfsBPRKOiJItV4NQcA316sUmJ3toTH ZyPJ6IQrEcJG0tZJN6//TQELNhj6R6mLx/YKPvAFgKgiVi1HcqNOMAACNsNsBZ56zFSR+t wm6IKyVOaRm+rhv2vQ9SbLS/sijphurp7x5WZzyo+DKY9Dqy8jbo5E6yt/auLUwx/PPLmL DBNEuIVCIW2UAhM9WSLrkoZyTbYreCWHPunrXX9jxqOaxd6/jSz9kCknFy1pRivtdbyXcE lHX+ItuHik5kRZv3R+XN3Yg90O0hqtCnHJ0OMIiGfGafeJ2xiCYsQ6cR/2aH7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838670; 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=q9DRZt2VKZEQ0CmFGhJZN82IETtJr0DVNUbwrJ+wpPw=; b=URTLGRjkbeGOuIlEA3OQbAAXY6QdrQt55Dvh057/qeGu494+SqbG6nFRqJpUkjiHxvjmU6 aubtKuOflpo+EcTiVeJyMNyP/M7hXotnQKNpKDXRCk3DHO1/ERFkWZRBiVyYg+Da6aHJEh Wszbn1q2vFecxouPJGTaueFBev+ydlkOrPjTQpI1dBFEia9bRJpEh4eMVSqxxCRtNZweCY xVNac22TMAm5zQ2Gdh8YtFE430+igAmcYfCQI2C5PuzohUP3KTmQsQEbhU14x27kjynafT I5e82v7p8D4Pij0p8cxOqhXmF532APSli4Fonk9VtJeye7g6IE4KeC1qqEFUdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838670; a=rsa-sha256; cv=none; b=jOx3JQ59WrG9LNGcvcplL4RGvR8ozcKx47BekID3zjsg1WxDmDCrVIaQPhAgADmIySd2Bg TT8rtY8YDTnjEgMgs6gzGIGlwYOlklJWBmLGFu1sYHp4m23EY09ZYx1jwFRPTxOtFafV0g xHf95MnRjG2PNj8G+6N8nhmj0Qd8JsxDnZ7kWgzLu7AmZinBV5ffQ/K5YC1n0tOmAfhOz5 PR8qhKsCZiqIMVV4Et7SCELU5H8V4DgZB9SNZzqT8B1Qpp+ioEUHDVbOfAwErix4Lwtknm a+ILr+EknahxEltou/sd4EeRp8y9JWrJbQSY5trdq2M2ahTKEgv6Uxpwo/v81A== 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 4YG6L62N1KzrtX; Sun, 22 Dec 2024 03:37:50 +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 4BM3bodr052961; Sun, 22 Dec 2024 03:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bobZ052957; Sun, 22 Dec 2024 03:37:50 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:50 GMT Message-Id: <202412220337.4BM3bobZ052957@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: c620dfb037e7 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: c620dfb037e7cdcbc26f33edf8afa4764c3757ac Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c620dfb037e7cdcbc26f33edf8afa4764c3757ac commit c620dfb037e7cdcbc26f33edf8afa4764c3757ac Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:25:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:33:27 +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 618a6d2d5c31..45ef1995063e 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; @@ -747,16 +748,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);