From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754581AbdIGIJv (ORCPT ); Thu, 7 Sep 2017 04:09:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:35261 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753826AbdIGIJu (ORCPT ); Thu, 7 Sep 2017 04:09:50 -0400 Date: Thu, 07 Sep 2017 10:09:48 +0200 Message-ID: From: Takashi Iwai To: "SF Markus Elfring" Cc: , "Dan Carpenter" , "Bhumika Goyal" , "Ingo Molnar" , "Jaroslav Kysela" , "David Howells" , , "LKML" Subject: Re: [PATCH 1/3] ALSA: ymfpci: Use common error handling code in snd_card_ymfpci_probe() In-Reply-To: <1b93c810-34c7-8439-d7cd-c303185dfe66@users.sourceforge.net> References: <20170906215120.m7ifun3doq5famva@mwanda> <1b93c810-34c7-8439-d7cd-c303185dfe66@users.sourceforge.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 07 Sep 2017 09:41:39 +0200, SF Markus Elfring wrote: > > >> @@ -336,21 +331,24 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, > >> legacy_ctrl &= ~YMFPCI_LEGACY_FMEN; > >> pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); > >> } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { > >> - snd_card_free(card); > > ^^^^^^^^^^^^^^^^^^^ > >> dev_err(card->dev, "cannot create opl3 hwdep\n"); > > ^^^^^^^^^ > >> - return err; > >> + goto free_card; > > > > Heh. I was worried that some of these re-orderings would introduce bugs > > but actually this one fixes a use after free. > > Thanks for your constructive feedback. > > Does it mean that a special tag should be added to a commit message? No need for resend, I'll add some more notes at merging. thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Date: Thu, 07 Sep 2017 08:09:48 +0000 Subject: Re: [PATCH 1/3] ALSA: ymfpci: Use common error handling code in snd_card_ymfpci_probe() Message-Id: List-Id: References: <20170906215120.m7ifun3doq5famva@mwanda> <1b93c810-34c7-8439-d7cd-c303185dfe66@users.sourceforge.net> In-Reply-To: <1b93c810-34c7-8439-d7cd-c303185dfe66@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring Cc: alsa-devel@alsa-project.org, Dan Carpenter , Bhumika Goyal , Ingo Molnar , Jaroslav Kysela , David Howells , kernel-janitors@vger.kernel.org, LKML On Thu, 07 Sep 2017 09:41:39 +0200, SF Markus Elfring wrote: > > >> @@ -336,21 +331,24 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, > >> legacy_ctrl &= ~YMFPCI_LEGACY_FMEN; > >> pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); > >> } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { > >> - snd_card_free(card); > > ^^^^^^^^^^^^^^^^^^^ > >> dev_err(card->dev, "cannot create opl3 hwdep\n"); > > ^^^^^^^^^ > >> - return err; > >> + goto free_card; > > > > Heh. I was worried that some of these re-orderings would introduce bugs > > but actually this one fixes a use after free. > > Thanks for your constructive feedback. > > Does it mean that a special tag should be added to a commit message? No need for resend, I'll add some more notes at merging. thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/3] ALSA: ymfpci: Use common error handling code in snd_card_ymfpci_probe() Date: Thu, 07 Sep 2017 10:09:48 +0200 Message-ID: References: <20170906215120.m7ifun3doq5famva@mwanda> <1b93c810-34c7-8439-d7cd-c303185dfe66@users.sourceforge.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <1b93c810-34c7-8439-d7cd-c303185dfe66@users.sourceforge.net> Sender: linux-kernel-owner@vger.kernel.org To: SF Markus Elfring Cc: alsa-devel@alsa-project.org, Dan Carpenter , Bhumika Goyal , Ingo Molnar , Jaroslav Kysela , David Howells , kernel-janitors@vger.kernel.org, LKML List-Id: alsa-devel@alsa-project.org On Thu, 07 Sep 2017 09:41:39 +0200, SF Markus Elfring wrote: > > >> @@ -336,21 +331,24 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, > >> legacy_ctrl &= ~YMFPCI_LEGACY_FMEN; > >> pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); > >> } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { > >> - snd_card_free(card); > > ^^^^^^^^^^^^^^^^^^^ > >> dev_err(card->dev, "cannot create opl3 hwdep\n"); > > ^^^^^^^^^ > >> - return err; > >> + goto free_card; > > > > Heh. I was worried that some of these re-orderings would introduce bugs > > but actually this one fixes a use after free. > > Thanks for your constructive feedback. > > Does it mean that a special tag should be added to a commit message? No need for resend, I'll add some more notes at merging. thanks, Takashi