From nobody Mon Nov 18 04:32:46 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 4XsF9B319Xz5dqFC; Mon, 18 Nov 2024 04:32:46 +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 4XsF9B2ZRkz4lTZ; Mon, 18 Nov 2024 04:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731904366; 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=VSmVKz15ewu3IOzVbvpGEmLtIUP7igT4Pto5UpLTvFo=; b=NPnjhwb+xNBcUIFtzBw51ViQJWDUeE/z54oyoSkzQoisX2qzroxl7OHasj4eXd1120iUu9 lp1CtCP4D+ByV7WWXgP1D2Cd4RH3LJnpzGWsqYrAiFMCU3Ugk+o9AvNWoWIbcepUKMJuWH myxtzbE6Oo27jq/gsYxKKqFC8JuuLXpWxsXFWVlkyaWT7oGvowEg1wFtgCyZVKAmo9YyYv ok4IHOqDISnKMkQxSIG/4cpQjFYaB3xXuDp9xnrpVKI0OrRIB34jRIuqEafqvfLoVGGXEu 9lC3Fqj6qMySDY0jx71ZBeQWzPAOiWflQM5I8dcoA6bQFz1z2VhWp0qv7sBgsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731904366; 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=VSmVKz15ewu3IOzVbvpGEmLtIUP7igT4Pto5UpLTvFo=; b=a+6m1CfFjIWCrviENvOQA5lc+p1ceSDPRmszbnONZ6P57F/40w8hMa3VyHn66enjT3/j4j sE0UueARHW0NKWOunJtxeNqX50c+l5yZ7Bx+1/ou0XutxDLay6mBH3VnO6UKvnxTXh9Qm0 p1RylCZn491CLvQXpRDk4BzRhdzFdqNt52fh7zwTiVCLEGzzDDF42pkPTHuLKJjeYwzMG1 QkmUp1WA8LyUTy8eJI6CrZwOsNDDYfCcfI0bFKQBJBA4RcFECoYPl8UXjVX+63cUjoGczU CkwO4O5lRXQaA3hl15U0EWI3MGV7iH7as6wnJiIMV3WPEljTI6NUDMVn340RVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731904366; a=rsa-sha256; cv=none; b=ZQCzJhiZCmywInpBwQ7NU+wFFHZuaGkkcRgMWU7HSz4VeMAfPbS/5OFRM+COqUHQAE5gPj SssyjiFM6x3LpskbAla9nQUhISe7Zn54T/f3r0XQjqG/z1r6VtmKl1upuJ4ZAH/Y9on7ze ScWHK6kM/a0mfByyGAFGQfuJYyZLMmi0XIo6L65nGtobJHQjBAN+cZ1mxy996dFv59Y27k JvN4BZrGNsEXto8BpCNXH1+jlsrmzfcqOE5Pefb4dFMpRuXKOkcHBrzTdKrgrDTkMvIGRl Tew09t0XugqkkHSCIF4U8AePqJV1X55JEd9rcJyaRVucQYbr2lUSfdDk6yWfCg== 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 4XsF9B2BmPzM6k; Mon, 18 Nov 2024 04:32:46 +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 4AI4Wkiv051133; Mon, 18 Nov 2024 04:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AI4WkV7051130; Mon, 18 Nov 2024 04:32:46 GMT (envelope-from git) Date: Mon, 18 Nov 2024 04:32:46 GMT Message-Id: <202411180432.4AI4WkV7051130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: f4f46a2eef3b - main - 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/main X-Git-Reftype: branch X-Git-Commit: f4f46a2eef3be6d19c65a4ca4ee70f365dd5be4f Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f4f46a2eef3be6d19c65a4ca4ee70f365dd5be4f commit f4f46a2eef3be6d19c65a4ca4ee70f365dd5be4f Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:25:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-18 04:31:39 +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 --- 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 6a05b633cfc8..ccfdcdddf545 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);