Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934081AbbGHLPB (ORCPT ); Wed, 8 Jul 2015 07:15:01 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:44124 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758614AbbGHLOz (ORCPT ); Wed, 8 Jul 2015 07:14:55 -0400 Date: Wed, 8 Jul 2015 12:14:37 +0100 From: Mark Brown To: Koro Chen Cc: perex@perex.cz, tiwai@suse.de, lgirdwood@gmail.com, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, bardliao@realtek.com, oder_chiou@realtek.com Message-ID: <20150708111437.GQ11162@sirena.org.uk> References: <1436343951-3482-1-git-send-email-koro.chen@mediatek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fuid1o0BiVNrPGA3" Content-Disposition: inline In-Reply-To: <1436343951-3482-1-git-send-email-koro.chen@mediatek.com> X-Cookie: Stay together, drag each other down. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/2] ASoC: rt5645: Fix missing free_irq X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1566 Lines: 44 --fuid1o0BiVNrPGA3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 08, 2015 at 04:25:50PM +0800, Koro Chen wrote: > The driver does not free irq if snd_soc_register_codec fails. > It does not return error when request irq failed, either. > Fix this by using devm_request_threaded_irq(), and returns when error. Unfortunately this isn't safe... > - if (i2c->irq) > - free_irq(i2c->irq, rt5645); > - > cancel_delayed_work_sync(&rt5645->jack_detect_work); This work item is queued up by the interrupt handler so we need to unregister the interrupt before we cancel any pending work otherwise it's possible that the interrupt may fire after we cancelled the work. --fuid1o0BiVNrPGA3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVnQYcAAoJECTWi3JdVIfQhB0H/icd/tZA906AXEXSTJ+nL3JB 8E62zwz6jzoRV5rp5rQ74RL4cDKDjEUT8JftlLErd4yztYyGWf0HihWutumhaDGK lBZWxWOWvEVK2MWenAagYWTQCroPY/sTQTv0owry3oTjFSs1D9OZWToduhB/TIaD jQfJLGwNh2dY0lvi76zXJzWtLVNotDHOU5QCv/UE4jjeKKv+Z9hPrZ9WCQVk6Sde VFyFg/7nKJb2tqwhuNEs+f6QKS12fY6ZDTeyoewZwTe42MX8ak2prvxmgESDsSbG ecNC/rtkP112YJwP6gQWkhfHQc9vxxsw5EsBGqxcjTmbwZeFM2x0gDEMo4fsvfs= =i8DX -----END PGP SIGNATURE----- --fuid1o0BiVNrPGA3-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/