From patchwork Wed Feb 24 16:18:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8409251 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 07C929F52D for ; Wed, 24 Feb 2016 16:19:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A89F20376 for ; Wed, 24 Feb 2016 16:19:34 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 061BD2037E for ; Wed, 24 Feb 2016 16:19:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 24D86264F39; Wed, 24 Feb 2016 17:19:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 48B8926149E; Wed, 24 Feb 2016 17:19:28 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DD7FD261521; Wed, 24 Feb 2016 17:19:26 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id C43162606F6 for ; Wed, 24 Feb 2016 17:19:19 +0100 (CET) Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MBr6d-1agcEJ0kUh-00Ambb; Wed, 24 Feb 2016 17:19:04 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Date: Wed, 24 Feb 2016 17:18:58 +0100 Message-ID: <3238725.1iS2dg6EkI@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1455634059-1896914-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:mQH4uLqO/mnqury8cXOoUBpQHUdE/4QzfA6WPzyTXb2BiIQPnEO Ek9Ylf9HEZey61/XxrOwZGDVQLE4zhSRcIjEFjJzS+GiNkby3mCMGTYa5tsc/vEUO2m+n20 5r49B6rXqCWuLFwr8v0goFi9u/ZXfI84gOjacu8P3fbHGMS1cRCIN2lsV/IGYYxT92xStVr zg7a1LeuiH+lM+t/cAhvg== X-UI-Out-Filterresults: notjunk:1; V01:K0:bN3+3xkmYYk=:zgeXAt8upfmbrHcw2lwKXp McZ3pu5lHapY/Fr+RxDd+5tICZ0oqB7ruHVVNfa7Kr2PrV3GwG4EXOEZm//UQRFDQhbuU+ZCn /ZXBbuNfQkHImrS/AZOzFvtjqPnSdqp28/aQfMyH2D9hR8rTaYMqUex3s8rjavxzjS+/Udz8j KSFKDVssP/Np8HIfLMw75PjP7dxDV2ahtDUF3QWVSxVreNHbBlsBsveBiQDOH1OkL230BcG3U bd+Mi6rXuNwAGU0YGG1QRC4hepzL8LQK1/Euo9/Zk5B8ydkj0FxJrFSrVVOV11/lh63tALWcl f1BdwusyjyPvqnbCKPcybuhtpFgwwcHuFmSK9a5c2skntaJxCreTcW0exy9LULXu/kRaDRKOj n9JHDYxaIU8/0AHrYmcn5Vc+pNKacIvUdEwY+H5tP9ryBlGrW1UUwA/y4Fv4yxS5uosdY4Dmb 50K8FguDMkWY0iG3+3IF60cpSOGsld9UpbMzfiaNRrNQJBTtITZEqUbs5Jg1ITNQ1hRbdSrsh V0OpWUIJV19RLRTq/aVVF/mg5yNK20v/iu+F9umWw76XeliyY9TbPUMqy1rrQE3hZ/hAobFhk SGNZGYeK6hYPzB0TCQe7IuHVE0UILJvsN10jtjLEEgE0GXOEDnbDzOJqXzXsAAgODAyJEdTR0 oBEIc7JHf8LcTciBJmr6C+VcNMndw9PMoUXdoKGjg+PzRLRzzAhDrAXSBDb+Szg+ZljwT/xCg 4E/TfOTnQOh+qjE8 Cc: alsa-devel@alsa-project.org, Takashi Iwai , linux-kernel@vger.kernel.org, Mark Brown , Han Lu , Libin Yang , Thierry Reding , David Henningsson Subject: Re: [alsa-devel] [PATCH] sound: hdmi: avoid dereferencing uninitialized 'jack' pointer X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Wednesday 17 February 2016 10:35:40 Takashi Iwai wrote: > On Wed, 17 Feb 2016 10:03:50 +0100, > + const char *id; > +#ifdef CONFIG_SND_JACK_INPUT_DEV > + struct input_dev *input_dev; > int registered; > int type; > - const char *id; > char name[100]; > unsigned int key[6]; /* Keep in sync with definitions above */ > +#endif /* CONFIG_SND_JACK_INPUT_DEV */ > void *private_data; > void (*private_free)(struct snd_jack *); > }; I got a build error from this today, as the trace event tries to print the jack "name" field. I've managed to get it to build again by printing the "id" field in place of the "name". The name is normally assigned from id in snd_jack_dev_register using snprintf(jack->name, sizeof(jack->name), "%s %s", card->shortname, jack->id); but that code is not called here at all. My patch will slightly alter the output as a consequence, but I don't know if this change is critical or not. Arnd diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 317a1ed2f4ac..9130dd5a184a 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h @@ -231,13 +231,13 @@ TRACE_EVENT(snd_soc_jack_report, TP_ARGS(jack, mask, val), TP_STRUCT__entry( - __string( name, jack->jack->name ) + __string( name, jack->jack->id ) __field( int, mask ) __field( int, val ) ), TP_fast_assign( - __assign_str(name, jack->jack->name); + __assign_str(name, jack->jack->id); __entry->mask = mask; __entry->val = val; ), @@ -253,12 +253,12 @@ TRACE_EVENT(snd_soc_jack_notify, TP_ARGS(jack, val), TP_STRUCT__entry( - __string( name, jack->jack->name ) + __string( name, jack->jack->id ) __field( int, val ) ), TP_fast_assign( - __assign_str(name, jack->jack->name); + __assign_str(name, jack->jack->id); __entry->val = val; ),