Skip to contentSkip to conversation

ALSA: hda: Abort capability probe on invalid capability

PATCH Applied Rakesh Ughreja 3 participants 3 messages Oct 24, 2017 Sound

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ALSA: hda: Abort capability probe on invalid capability

On reading wrong capability pointer values driver may crash, so whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

---
 sound/hda/hdac_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/hda/hdac_controller.c +2 -1
index 978dc18..8f7d0d9 100644
@@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
+			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+			cur_cap = 0;
 			break;
 		}
 
Signature · 1 line
2.7.4
Acked-by on v3 1/1
#1 lore raw
Quoted 3 lines · Rakesh Ughreja

On reading wrong capability pointer values driver may crash, so whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

Quoted 22 lines
---
 sound/hda/hdac_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/hda/hdac_controller.c +2 -1
index 978dc18..8f7d0d9 100644
@@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
+			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+			cur_cap = 0;
 			break;
 		}
 
Signature · 1 line
2.7.4
Signature · 1 line
~Vinod