FreeBSD Bugzilla – Attachment 232613 Details for
Bug 262671
Kernel panics after a invalid SNDCTL_MIXERINFO ioctl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
possible patch
pr262671.patch (text/plain), 1.88 KB, created by
Ed Maste
on 2022-03-21 16:18:55 UTC
(
hide
)
Description:
possible patch
Filename:
MIME Type:
Creator:
Ed Maste
Created:
2022-03-21 16:18:55 UTC
Size:
1.88 KB
patch
obsolete
>commit ab035f10b1a08aca01b1489872d6bb947b01c4ac >Author: Ed Maste <emaste@FreeBSD.org> >Date: Mon Mar 21 12:15:22 2022 -0400 > > sound: test PCM_REGISTERED before PCM_DETACHING > > PCM_REGISTERED(d) tests that d is not NULL, so put that check first. > >diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c >index 89e78b036e94..bbc57f737036 100644 >--- a/sys/dev/sound/pcm/mixer.c >+++ b/sys/dev/sound/pcm/mixer.c >@@ -153,7 +153,7 @@ mixer_set_softpcmvol(struct snd_mixer *m, struct snddev_info *d, > struct pcm_channel *c; > int dropmtx, acquiremtx; > >- if (PCM_DETACHING(d) || !PCM_REGISTERED(d)) >+ if (!PCM_REGISTERED(d) || PCM_DETACHING(d)) > return (EINVAL); > > if (mtx_owned(m->lock)) >@@ -206,7 +206,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *d, > else > return (EINVAL); > >- if (PCM_DETACHING(d) || !PCM_REGISTERED(d)) >+ if (!PCM_REGISTERED(d) || PCM_DETACHING(d)) > return (EINVAL); > > if (mtx_owned(m->lock)) >@@ -1083,7 +1083,7 @@ mixer_open(struct cdev *i_dev, int flags, int mode, struct thread *td) > > m = i_dev->si_drv1; > d = device_get_softc(m->dev); >- if (PCM_DETACHING(d) || !PCM_REGISTERED(d)) >+ if (!PCM_REGISTERED(d) || PCM_DETACHING(d)) > return (EBADF); > > /* XXX Need Giant magic entry ??? */ >@@ -1239,7 +1239,7 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, > return (EBADF); > > d = device_get_softc(((struct snd_mixer *)i_dev->si_drv1)->dev); >- if (PCM_DETACHING(d) || !PCM_REGISTERED(d)) >+ if (!PCM_REGISTERED(d) || PCM_DETACHING(d)) > return (EBADF); > > PCM_GIANT_ENTER(d); >@@ -1460,7 +1460,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) > for (i = 0; pcm_devclass != NULL && > i < devclass_get_maxunit(pcm_devclass); i++) { > d = devclass_get_softc(pcm_devclass, i); >- if (PCM_DETACHING(d) || !PCM_REGISTERED(d)) >+ if (!PCM_REGISTERED(d) || PCM_DETACHING(d)) > continue; > > /* XXX Need Giant magic entry */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262671
:
232581
|
232582
| 232613