diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 44e65f984a5c..da3cd7cf5808 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2957,7 +2957,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
 	if (!routes) {
 		dev_err(card->dev,
 			"ASoC: Could not allocate DAPM route table\n");
-		return -EINVAL;
+		return -ENOMEM;
 	}
 
 	for (i = 0; i < num_routes; i++) {