summaryrefslogtreecommitdiff
path: root/sound/usb/validate.c
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2025-08-20 16:08:49 +0200
committerMaxime Ripard <mripard@kernel.org>2025-08-20 16:08:49 +0200
commit1a2cf179e2973f6801c67397ecc987391b084bcf (patch)
tree9212405e147d9750d493f9f785afdb2769a263c7 /sound/usb/validate.c
parent3271faf42d135bcf569c3ff6af55c21858eec212 (diff)
parentc17b750b3ad9f45f2b6f7e6f7f4679844244f0b9 (diff)
Merge drm/drm-fixes into drm-misc-fixes
Update drm-misc-fixes to -rc2. Signed-off-by: Maxime Ripard <mripard@kernel.org>
Diffstat (limited to 'sound/usb/validate.c')
-rw-r--r--sound/usb/validate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/usb/validate.c b/sound/usb/validate.c
index 6fe206f6e911..4f4e8e87a14c 100644
--- a/sound/usb/validate.c
+++ b/sound/usb/validate.c
@@ -221,6 +221,17 @@ static bool validate_uac3_feature_unit(const void *p,
return d->bLength >= sizeof(*d) + 4 + 2;
}
+static bool validate_uac3_power_domain_unit(const void *p,
+ const struct usb_desc_validator *v)
+{
+ const struct uac3_power_domain_descriptor *d = p;
+
+ if (d->bLength < sizeof(*d))
+ return false;
+ /* baEntities[] + wPDomainDescrStr */
+ return d->bLength >= sizeof(*d) + d->bNrEntities + 2;
+}
+
static bool validate_midi_out_jack(const void *p,
const struct usb_desc_validator *v)
{
@@ -285,6 +296,7 @@ static const struct usb_desc_validator audio_validators[] = {
struct uac3_clock_multiplier_descriptor),
/* UAC_VERSION_3, UAC3_SAMPLE_RATE_CONVERTER: not implemented yet */
/* UAC_VERSION_3, UAC3_CONNECTORS: not implemented yet */
+ FUNC(UAC_VERSION_3, UAC3_POWER_DOMAIN, validate_uac3_power_domain_unit),
{ } /* terminator */
};