From patchwork Sat Feb 21 21:45:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 5860681 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 34346BF440 for ; Sat, 21 Feb 2015 21:45:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62D662053C for ; Sat, 21 Feb 2015 21:45:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FBD52053A for ; Sat, 21 Feb 2015 21:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751671AbbBUVpm (ORCPT ); Sat, 21 Feb 2015 16:45:42 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:44794 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbbBUVpl (ORCPT ); Sat, 21 Feb 2015 16:45:41 -0500 Received: by lams18 with SMTP id s18so12251462lam.11 for ; Sat, 21 Feb 2015 13:45:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=nTYSBfJroyRs3td4ZBoT2OlSdnrROLItBk7XtnnEZ0w=; b=lWWSiOxUVgRsPvcMNTbnNsi9Wu6VxYzsgHG1SDPbe14JVpnzu/YARF+rdTIwsagAb9 4eZ8rPWApiH2CcKjXE3QyR5h6D1XAGzvUrDo8wZ/Vyvah0RxuXqMpboRAB/PkNd0wdPH ZRmNuBSkNUh7Q5EPweCN+LW4uXonuBJCjowepZQStNqN3fYlFmvrQ9wLjZ85W13mm0m2 BjyP7uVWs2UXClDXN9s0QIP/ewt1MH5sj8vKAKcdOn7tUmH34WztUjTq/HrWMRza5JHH jSoBu2/M+Pp5Y3s4UzaTx+IPTL0cx2w0g+1rijb4au8uQBb4/qfzN7cQM9a9WoeS3tl5 jJKw== X-Gm-Message-State: ALoCoQmVkM10Vgh7KbSf2eKKBkB62LnkJCBDK79nhJHxU/p1gFZjQXjFzBxW2a/YUiBZKASXYQte X-Received: by 10.112.142.134 with SMTP id rw6mr3604686lbb.100.1424555140095; Sat, 21 Feb 2015 13:45:40 -0800 (PST) Received: from dl160.lan (37-33-50-203.bb.dnainternet.fi. [37.33.50.203]) by mx.google.com with ESMTPSA id ch1sm6315203lbb.40.2015.02.21.13.45.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 Feb 2015 13:45:39 -0800 (PST) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCH] saa7164: free_irq before pci_disable_device Date: Sat, 21 Feb 2015 23:45:26 +0200 Message-Id: <1424555126-26151-1-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Free the IRQ before disabling the device. Otherwise errors like this when unloading the module: [21135.458560] ------------[ cut here ]------------ [21135.458569] WARNING: CPU: 4 PID: 1696 at /home/apw/COD/linux/fs/proc/generic.c:521 remove_proc_entry+0x1a1/0x1b0() [21135.458572] remove_proc_entry: removing non-empty directory 'irq/47', leaking at least 'saa7164[0]' Signed-off-by: Olli Salonen Reviewed-by: Steven Toth --- drivers/media/pci/saa7164/saa7164-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index 4b0bec3..9cf3c6c 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c @@ -1436,11 +1436,11 @@ static void saa7164_finidev(struct pci_dev *pci_dev) saa7164_i2c_unregister(&dev->i2c_bus[1]); saa7164_i2c_unregister(&dev->i2c_bus[2]); - pci_disable_device(pci_dev); - /* unregister stuff */ free_irq(pci_dev->irq, dev); + pci_disable_device(pci_dev); + mutex_lock(&devlist); list_del(&dev->devlist); mutex_unlock(&devlist);