diff options
author | Christos Margiolis <christos@FreeBSD.org> | 2024-05-20 14:18:33 +0000 |
---|---|---|
committer | Christos Margiolis <christos@FreeBSD.org> | 2024-05-21 17:45:55 +0000 |
commit | 45feaa73c68011bbba647d1eb6f86a166a0453e9 (patch) | |
tree | f8fc1d40ae87248a99cc954019295e703c54dd1a | |
parent | 5830a00c2c5485ec17900558e4f29c459c6a1f3e (diff) | |
download | src-45feaa73c68011bbba647d1eb6f86a166a0453e9.tar.gz src-45feaa73c68011bbba647d1eb6f86a166a0453e9.zip |
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)
-rw-r--r-- | sys/dev/sound/pcm/sndstat.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |