/* * linux/sound/soc/pxa/ttc_dkb.c * * Copyright (C) 2012 Marvell International Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include "../codecs/88pm860x-codec.h" static struct snd_soc_jack hs_jack, mic_jack; static struct snd_soc_jack_pin hs_jack_pins[] = { { .pin = "Headset Stereophone", .mask = SND_JACK_HEADPHONE, }, }; static struct snd_soc_jack_pin mic_jack_pins[] = { { .pin = "Headset Mic 2", .mask = SND_JACK_MICROPHONE, }, }; /* ttc machine dapm widgets */ static const struct snd_soc_dapm_widget ttc_dapm_widgets[] = { SND_SOC_DAPM_HP("Headset Stereophone", NULL), SND_SOC_DAPM_LINE("Lineout Out 1", NULL), SND_SOC_DAPM_LINE("Lineout Out 2", NULL), SND_SOC_DAPM_SPK("Ext Speaker", NULL), SND_SOC_DAPM_MIC("Ext Mic 1", NULL), SND_SOC_DAPM_MIC("Headset Mic 2", NULL), SND_SOC_DAPM_MIC("Ext Mic 3", NULL), }; /* ttc machine audio map */ static const struct snd_soc_dapm_route ttc_audio_map[] = { {"Headset Stereophone", NULL, "HS1"}, {"Headset Stereophone", NULL, "HS2"}, {"Ext Speaker", NULL, "LSP"}, {"Ext Speaker", NULL, "LSN"}, {"Lineout Out 1", NULL, "LINEOUT1"}, {"Lineout Out 2", NULL, "LINEOUT2"}, {"MIC1P", NULL, "Mic1 Bias"}, {"MIC1N", NULL, "Mic1 Bias"}, {"Mic1 Bias", NULL, "Ext Mic 1"}, {"MIC2P", NULL, "Mic1 Bias"}, {"MIC2N", NULL, "Mic1 Bias"}, {"Mic1 Bias", NULL, "Headset Mic 2"}, {"MIC3P", NULL, "Mic3 Bias"}, {"MIC3N", NULL, "Mic3 Bias"}, {"Mic3 Bias", NULL, "Ext Mic 3"}, }; static int ttc_pm860x_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; /* Headset jack detection */ snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2, &hs_jack, hs_jack_pins, ARRAY_SIZE(hs_jack_pins)); snd_soc_card_jack_new(rtd->card, "Microphone Jack", SND_JACK_MICROPHONE, &mic_jack, mic_jack_pins, ARRAY_SIZE(mic_jack_pins)); /* headphone, microphone detection & headset short detection */ pm860x_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADPHONE, SND_JACK_BTN_0, SND_JACK_BTN_1, SND_JACK_BTN_2); pm860x_mic_jack_detect(codec, &hs_jack, SND_JACK_MICROPHONE); return 0; } /* ttc/td-dkb digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link ttc_pm860x_hifi_dai[] = { { .name = "88pm860x i2s", .stream_name = "audio playback", .codec_name = "88pm860x-codec", .platform_name = "mmp-pcm-audio", .cpu_dai_name = "pxa-ssp-dai.1", .codec_dai_name = "88pm860x-i2s", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, .init = ttc_pm860x_init, }, }; /* ttc/td audio machine driver */ static struct snd_soc_card ttc_dkb_card = { .name = "ttc-dkb-hifi", .owner = THIS_MODULE, .dai_link = ttc_pm860x_hifi_dai, .num_links = ARRAY_SIZE(ttc_pm860x_hifi_dai), .dapm_widgets = ttc_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(ttc_dapm_widgets), .dapm_routes = ttc_audio_map, .num_dapm_routes = ARRAY_SIZE(ttc_audio_map), }; static int ttc_dkb_probe(struct platform_device *pdev) { struct snd_soc_card *card = &ttc_dkb_card; int ret; card->dev = &pdev->dev; ret = devm_snd_soc_register_card(&pdev->dev, card); if (ret) dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); return ret; } static struct platform_driver ttc_dkb_driver = { .driver = { .name = "ttc-dkb-audio", .pm = &snd_soc_pm_ops, }, .probe = ttc_dkb_probe, }; module_platform_driver(ttc_dkb_driver); /* Module information */ MODULE_AUTHOR("Qiao Zhou, "); MODULE_DESCRIPTION("ALSA SoC TTC DKB"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:ttc-dkb-audio"); e='0' selected='selected'>includemode:
authorPeter Zijlstra <peterz@infradead.org>2017-01-26 16:39:55 +0100
committerIngo Molnar <mingo@kernel.org>2017-01-30 11:41:25 +0100
commita76a82a3e38c8d3fb6499e3dfaeb0949241ab588 (patch)
treeb5bc906278fe1ac66d75de984d26bf59b43b3ed8 /sound/usb/6fire/common.h
parent566cf877a1fcb6d6dc0126b076aad062054c2637 (diff)
perf/core: Fix use-after-free bug
Dmitry reported a KASAN use-after-free on event->group_leader. It turns out there's a hole in perf_remove_from_context() due to event_function_call() not calling its function when the task associated with the event is already dead. In this case the event will have been detached from the task, but the grouping will have been retained, such that group operations might still work properly while there are live child events etc. This does however mean that we can miss a perf_group_detach() call when the group decomposes, this in turn can then lead to use-after-free. Fix it by explicitly doing the group detach if its still required. Reported-by: Dmitry Vyukov <dvyukov@google.com> Tested-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org # v4.5+ Cc: syzkaller <syzkaller@googlegroups.com> Fixes: 63b6da39bb38 ("perf: Fix perf_event_exit_task() race") Link: http://lkml.kernel.org/r/20170126153955.GD6515@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'sound/usb/6fire/common.h')