From: Takashi Iwai Date: Mon, 17 Aug 2015 12:57:32 +0000 (+0200) Subject: ALSA: hda/proc - Fix racy string access for power states X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1d260d7b3b03f96dfbc9781ec046edc729220f09;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ALSA: hda/proc - Fix racy string access for power states The power states in a proc file are printed in a racy manner on a single static string buffer. Fix it by calling snd_iprintf() directly for each state instead of processing on a temporary buffer. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 5efcffc32c50..033aa84365b9 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -36,21 +36,6 @@ MODULE_PARM_DESC(dump_coef, "Dump processing coefficients in codec proc file (-1 #define param_read(codec, nid, parm) \ snd_hdac_read_parm_uncached(&(codec)->core, nid, parm) -static char *bits_names(unsigned int bits, const char * const names[], int size) -{ - int i, n; - static char buf[128]; - - for (i = 0, n = 0; i < size; i++) { - if (bits & (1U<