From nobody Tue May 21 17:53:57 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 4VkMWB3CzLz5Lv0y; Tue, 21 May 2024 17:53:58 +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 4VkMW96yKbz4r6G; Tue, 21 May 2024 17:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314038; 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=1qfZyL+IqSkiwEZYcfKFT7j6gRxaarXn+iKxg88OoVk=; b=i8IUxiJrLL7Hgo64pN0zRfsueIsvlgc8jQSQOb1ObM/SMXh/WwRSPmYN7+RvcWtm45R4yf w9KiD4pH88sdifL42cs7BOpsHrFcXSgrurPyVWf1AA6udGdgckzO2hQMqYTTEdZVrhQKNr J7ndPY3KVJ8mk01BRKwfJiz2smVzC4zbUKHuW102pQNwvyO34EnFEoQWNy0sHQxkDeyXr0 EOlfO78uH87gmJMufv17UwbZUq8rjE4U0z8YOV5f//itrc4n5DVbM2E3ULi+awru9Z/KNn 0jeJmAqfUUbLoDCZ0z6zfH578etKTCycXklQA+yKZG/dsqE4s8BjmI+YzY1W+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716314038; a=rsa-sha256; cv=none; b=oKi3idVndtWcI/jRX3Bx8LxZgRb4vBUcHfz5uR2S93xuRy3WFnKAlnj7VvDWTt0PxOH6ET D0XU6wHGIyd5cQyMYtlyhpg2SFaaS1ZQIbnXfeBEbaLBfS9OHoh7EbBXTnsSGrazz+2029 l+A/wyXcGbAZJ8BUHhabUgIqEMQ6VlxWbbLOhyVwjR5anjR+FUPHhr2cLWOimgOwwsg/B9 emjCWv0l51dbTrSQcyJR4XRN0rCaROe73IE/tXZT1BGQAw2Lrl8AnsCd/uAp9hfbesG2lM Gu3/vNwo6Rb24xcDhVkkkmCMHCF3FFRldYHhWLgl4xSlsnBBVQsWox5rGAqaJQ== 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=1716314038; 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=1qfZyL+IqSkiwEZYcfKFT7j6gRxaarXn+iKxg88OoVk=; b=IX9lXCZrSBQJdqwyGWnAufkUjVOabNqHHVp/SVDv/W3MZJanrDILIaYt1u7ghm0kXefbij J9bVL9K+6gZrZw+OY8N7A23cbqauQgn5hw6E4+FvO6k479/NWA86PIygCVfdz+un8ec4sT 93dm4bREqpv+CZrAj7+ZCZyMs1/MS3lsbrNZCsjCtynyMp9ETSBPkoN6HKGybOrdVFVqC5 a0lEo14p9fTLZOP+IbzjwfbJ792fufxwF6RlMquIhTUd8axdEDTCkmMHb63a3ujK6W5W8f n2gKcuJMmB1awPk7pY7zo64mjn14GT9tZDpVHFM1M+7UtRYtUhVpaXcCVjLJeg== 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 4VkMW96ZflzXpR; Tue, 21 May 2024 17:53:57 +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 44LHrv83021752; Tue, 21 May 2024 17:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LHrvqm021749; Tue, 21 May 2024 17:53:57 GMT (envelope-from git) Date: Tue, 21 May 2024 17:53:57 GMT Message-Id: <202405211753.44LHrvqm021749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 45feaa73c680 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 45feaa73c68011bbba647d1eb6f86a166a0453e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=45feaa73c68011bbba647d1eb6f86a166a0453e9 commit 45feaa73c68011bbba647d1eb6f86a166a0453e9 Author: Christos Margiolis AuthorDate: 2024-05-20 14:18:33 +0000 Commit: Christos Margiolis CommitDate: 2024-05-21 17:45:55 +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 (cherry picked from commit 64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a) --- 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); }