From nobody Mon May 20 14:18:48 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 4VjfnN4mRwz5LM4X; Mon, 20 May 2024 14:18:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjfnN48vMz4Wyp; Mon, 20 May 2024 14:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716214728; 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=O1LTbhjjqAWWKeM4naCzL6O4ixa/W54Ra15mLqT2RY0=; b=J7Miy9kvfeLYychPjoHWrxVW0SAuGDacqPxf0AW2QrF/ZLPEzNkMhtajBCCvEBKi6O9Cb4 Q845eLZSbItUufd0I1EFlAFjb3kErcNqdZ63sdg+VVgm68Kp5UP/eCnJ50ir+lRjyFQoOb vMCH2npKId8ZnmXg04/fhYkg0TDpW4UVbtwgjdw0VI9VHQiJxNPVSzI3cs+UsKS17Lk6ai yI9IQQqFZSOJOSXonZnJWb+zcE2Af86EeDYZYTlX9tVl71E7sAtJYxUPr41nPWPM8Fbnpl tn7JGyI1mWNIMLNoFl0ZH31x6dT+mhYsDCXXHQkEsj0MJO+Jof7BcYekLd9nZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716214728; a=rsa-sha256; cv=none; b=mOR1Kz937SDxQKK55+cdf4mIfvQi24xoyFXZPhu8bMQWrSQ08mK10LttLSjZj6Zy0MrXVn FSdf/IRyJVOHIEIMNj1bjMe3U0d611zK5Lfy6Iewqg9D3LjZS6fA6c1s7sZKlolqufcLK5 AO35L6NtGR/F1dwFWYhKM03EUq2//JpoWVe54K2DFHgNB1Ues1tpTVyQZH8rT4FketQHjj 6kTxp5wcHHuz7Kd1UG5aiN6reGmmEsNOjJ+w607+VTzPYwmA9+yl5Ft9GDs/m3wRFuKEdR LJoDWSfYTWFnEHgu8xV+jLpP9GjbqL4+Go6Yx5zB3AV/yX9mpw/OPu2m2AlAzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716214728; 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=O1LTbhjjqAWWKeM4naCzL6O4ixa/W54Ra15mLqT2RY0=; b=mHzjq+CIzVL1Y+ebp/uv/GH5UcDF78Q0pY6i61s9Q7hXVLamZBu1Mytpiz0PyIA8xizQU7 oe6Al3XVpkHhY2b6iNa7zWfO57CDqYXj2PA8/7kPLxe/f45kN9UtG6QhmFtA5UrcAoWNAf GmotIhqXFwU223JqNIr3E6CstoWD+VDtRhS1gO+a8eqkqMhPPJI9hUy1WlmQg5uruMqyxM s+511wPwVemYWvcTPb0n4ZTX37XQww8ds9KMIiRr/IyKKSmXXaKCvJoB8XzLwfW9xR8ce4 x0tmbXd4hTbH4alPNfwnKw2Y/z18UFF/ln34A/kUJW72gBcuZ+HhE5sCf9o7dQ== 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 4VjfnN3lvVzhYf; Mon, 20 May 2024 14:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KEImHi015044; Mon, 20 May 2024 14:18:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KEImbA015041; Mon, 20 May 2024 14:18:48 GMT (envelope-from git) Date: Mon, 20 May 2024 14:18:48 GMT Message-Id: <202405201418.44KEImbA015041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 64f4e2db6d19 - main - sound: Correctly check nvlist_unpack() error 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a commit 64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a Author: Christos Margiolis AuthorDate: 2024-05-20 14:18:33 +0000 Commit: Christos Margiolis CommitDate: 2024-05-20 14:18:33 +0000 sound: Correctly check nvlist_unpack() error The current check is never false and if nvlist_unpack() fails, we might panic later down the road. PR: 266144 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45237 --- sys/dev/sound/pcm/sndstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index f310d8f3bff3..bbcb2fda7c29 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -705,7 +705,7 @@ sndstat_unpack_user_nvlbuf(const void *unvlbuf, size_t nbytes, nvlist_t **nvl) } *nvl = nvlist_unpack(nvlbuf, nbytes, 0); free(nvlbuf, M_DEVBUF); - if (nvl == NULL) { + if (*nvl == NULL) { return (EINVAL); }