From dc50eab76b709d68175a358d6e23a5a3890764d3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 19:39:57 +0200 Subject: Merging upstream version 6.7.7. Signed-off-by: Daniel Baumann --- sound/soc/codecs/hdac_hdmi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sound/soc/codecs/hdac_hdmi.c') diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 8b6b760296..b9c5ffbfb5 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1771,7 +1771,6 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card, { struct hdac_hdmi_pin *pin; struct snd_kcontrol_new *kc; - char kc_name[NAME_SIZE], xname[NAME_SIZE]; char *name; int i = 0, j; struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); @@ -1785,14 +1784,14 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card, list_for_each_entry(pin, &hdmi->pin_list, head) { for (j = 0; j < pin->num_ports; j++) { - snprintf(xname, sizeof(xname), "hif%d-%d Jack", - pin->nid, pin->ports[j].id); - name = devm_kstrdup(component->dev, xname, GFP_KERNEL); + name = devm_kasprintf(component->dev, GFP_KERNEL, + "hif%d-%d Jack", + pin->nid, pin->ports[j].id); if (!name) return -ENOMEM; - snprintf(kc_name, sizeof(kc_name), "%s Switch", xname); - kc[i].name = devm_kstrdup(component->dev, kc_name, - GFP_KERNEL); + + kc[i].name = devm_kasprintf(component->dev, GFP_KERNEL, + "%s Switch", name); if (!kc[i].name) return -ENOMEM; -- cgit v1.2.3