提交 66797f36 编写于 作者: T Takashi Iwai

ALSA: hda - Pass printf argument directly to request_module()

request_module() handles the printf style arguments, so we don't have
to render strings in the caller side.  Not only it reduces the
unnecessary temporary string buffer, it's even safer from the security
POV.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 85c24cd8
......@@ -966,14 +966,12 @@ find_codec_preset(struct hda_codec *codec)
mutex_unlock(&preset_mutex);
if (mod_requested < HDA_MODREQ_MAX_COUNT) {
char name[32];
if (!mod_requested)
snprintf(name, sizeof(name), "snd-hda-codec-id:%08x",
codec->vendor_id);
request_module("snd-hda-codec-id:%08x",
codec->vendor_id);
else
snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*",
(codec->vendor_id >> 16) & 0xffff);
request_module(name);
request_module("snd-hda-codec-id:%04x*",
(codec->vendor_id >> 16) & 0xffff);
mod_requested++;
goto again;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册