sound fixes for 4.20-rc4

The only significant change is for OSS PCM emulation to convert
 with kvcalloc() to address both performance and security issues.
 It's a pretty straightforward change, which should be safe.
 
 The rest are, as usual, device-specific small fixes for HD-audio.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlv2hqEOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE87zA/+LhGdC0o4jI25J8dVQhi2tGC8md8L4YENy2Uk
 cTYV3tATNsZeNpWY/PvI46NQU3fiSUucIWEWjm1dLvSzbAFYtLXSriQLUK/ioZbg
 sWIrR8wJyPlrsMZOJZFtHeJhLkjuBjRxXLp4N420svyb8IMSOq41Z5xaQXDPD0jq
 BRykR8C3ZUhCnTuLJ+ZoSjRht/18+Rxb2DbT5sPyaP7iBJ4xNZkY9yKsLI9XbXbn
 2R+5iYlftYTr+NZ8KQuNQQ4+0HBTcYeJ/AYma2+wtgHJrJq0ATuOR1/v2TBJfOc9
 j1GtSfHUZagw1G1kdJ4QzKvc0mVGjFgEhVjRYgNWBEPg9RKYR6v1QXTEVZvel4dt
 fv5RLfLQaRmKTofTwiWROPe4rwKef/SmCeu7+1/ZaNIK0QuoPbvVSV5Ye9aNQxfk
 1VWTMbHGMJ2ZomGWLUkmDP7426J7xitHErE5tO4P3SXQiln8vbJwfKbVaWwsQgGB
 wlYJqOua2pvcimIq5wAOHJwJxwKxOCi+iOLwQRdQZE6V5sQcwoV1adKiMKq3sLxJ
 AUbfq1kilpzZ1/3GYyHikiN1W31ihOcmdvb9pIjiH5WamY4QgZPqf//nOLvO2U4s
 M0biO9rZHyrglwGSMuRCEP+sR5SBc+Pppe8/3uE/Onm2hgB+KvMghY2Hex5DcxaM
 WOCxND8=
 =ISp2
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "The only significant change is for OSS PCM emulation to convert with
  kvcalloc() to address both performance and security issues. It's a
  pretty straightforward change, which should be safe.

  The rest are, as usual, device-specific small fixes for HD-audio"

* tag 'sound-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/ca0132 - fix AE-5 pincfg
  ALSA: hda/ca0132 - Add new ZxR quirk
  ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()
  ALSA: hda/realtek - Add quirk entry for HP Pavilion 15
  ALSA: oss: Use kvzalloc() for local buffer allocations
This commit is contained in:
Linus Torvalds 2018-11-22 08:45:44 -08:00
commit edeca3a769
4 changed files with 10 additions and 8 deletions

View File

@ -1062,8 +1062,8 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
runtime->oss.channels = params_channels(params); runtime->oss.channels = params_channels(params);
runtime->oss.rate = params_rate(params); runtime->oss.rate = params_rate(params);
vfree(runtime->oss.buffer); kvfree(runtime->oss.buffer);
runtime->oss.buffer = vmalloc(runtime->oss.period_bytes); runtime->oss.buffer = kvzalloc(runtime->oss.period_bytes, GFP_KERNEL);
if (!runtime->oss.buffer) { if (!runtime->oss.buffer) {
err = -ENOMEM; err = -ENOMEM;
goto failure; goto failure;
@ -2328,7 +2328,7 @@ static void snd_pcm_oss_release_substream(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime; struct snd_pcm_runtime *runtime;
runtime = substream->runtime; runtime = substream->runtime;
vfree(runtime->oss.buffer); kvfree(runtime->oss.buffer);
runtime->oss.buffer = NULL; runtime->oss.buffer = NULL;
#ifdef CONFIG_SND_PCM_OSS_PLUGINS #ifdef CONFIG_SND_PCM_OSS_PLUGINS
snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_plugin_clear(substream);

View File

@ -66,8 +66,8 @@ static int snd_pcm_plugin_alloc(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t
return -ENXIO; return -ENXIO;
size /= 8; size /= 8;
if (plugin->buf_frames < frames) { if (plugin->buf_frames < frames) {
vfree(plugin->buf); kvfree(plugin->buf);
plugin->buf = vmalloc(size); plugin->buf = kvzalloc(size, GFP_KERNEL);
plugin->buf_frames = frames; plugin->buf_frames = frames;
} }
if (!plugin->buf) { if (!plugin->buf) {
@ -191,7 +191,7 @@ int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin)
if (plugin->private_free) if (plugin->private_free)
plugin->private_free(plugin); plugin->private_free(plugin);
kfree(plugin->buf_channels); kfree(plugin->buf_channels);
vfree(plugin->buf); kvfree(plugin->buf);
kfree(plugin); kfree(plugin);
return 0; return 0;
} }

View File

@ -1177,6 +1177,7 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE), SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE),
SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ), SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ),
SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ), SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ),
SND_PCI_QUIRK(0x1102, 0x0033, "Sound Blaster ZxR", QUIRK_SBZ),
SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI), SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI),
SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI), SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI),
SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI), SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
@ -8413,7 +8414,7 @@ static void ca0132_free(struct hda_codec *codec)
snd_hda_power_down(codec); snd_hda_power_down(codec);
if (spec->mem_base) if (spec->mem_base)
iounmap(spec->mem_base); pci_iounmap(codec->bus->pci, spec->mem_base);
kfree(spec->spec_init_verbs); kfree(spec->spec_init_verbs);
kfree(codec->spec); kfree(codec->spec);
} }
@ -8488,7 +8489,7 @@ static void ca0132_config(struct hda_codec *codec)
break; break;
case QUIRK_AE5: case QUIRK_AE5:
codec_dbg(codec, "%s: QUIRK_AE5 applied.\n", __func__); codec_dbg(codec, "%s: QUIRK_AE5 applied.\n", __func__);
snd_hda_apply_pincfgs(codec, r3di_pincfgs); snd_hda_apply_pincfgs(codec, ae5_pincfgs);
break; break;
} }

View File

@ -6481,6 +6481,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),