From patchwork Mon Sep 2 00:40:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 2852632 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6C2B79F313 for ; Mon, 2 Sep 2013 00:40:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6EFB20212 for ; Mon, 2 Sep 2013 00:40:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E5D82020A for ; Mon, 2 Sep 2013 00:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757805Ab3IBAkN (ORCPT ); Sun, 1 Sep 2013 20:40:13 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:60582 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757711Ab3IBAkN (ORCPT ); Sun, 1 Sep 2013 20:40:13 -0400 Received: from deadeye.wl.decadent.org.uk ([192.168.4.101]) by shadbolt.decadent.org.uk with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1VGIBf-0005Ee-QG; Mon, 02 Sep 2013 01:40:11 +0100 Received: from ben by deadeye.wl.decadent.org.uk with local (Exim 4.80) (envelope-from ) id 1VGIBe-0005D0-Fm; Mon, 02 Sep 2013 01:40:10 +0100 Message-ID: <1378082410.25743.62.camel@deadeye.wl.decadent.org.uk> Subject: [PATCH 3/4] [media] lirc_bt829: Fix iomap leak From: Ben Hutchings To: Jarod Wilson , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org Date: Mon, 02 Sep 2013 01:40:10 +0100 In-Reply-To: <1378082213.25743.58.camel@deadeye.wl.decadent.org.uk> References: <1378082213.25743.58.camel@deadeye.wl.decadent.org.uk> X-Mailer: Evolution 3.4.4-3 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.4.101 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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 We must call iounmap() when removed from a device. Signed-off-by: Ben Hutchings --- drivers/staging/media/lirc/lirc_bt829.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/lirc/lirc_bt829.c b/drivers/staging/media/lirc/lirc_bt829.c index 8c5ba2a..76e6cfb 100644 --- a/drivers/staging/media/lirc/lirc_bt829.c +++ b/drivers/staging/media/lirc/lirc_bt829.c @@ -140,12 +140,14 @@ static int atir_pci_probe(struct pci_dev *pdev, if (atir->minor < 0) { dev_err(&pdev->dev, "failed to register driver!\n"); rc = atir->minor; - goto err_free; + goto err_unmap; } dprintk("driver is registered on minor %d\n", atir->minor); return 0; +err_unmap: + iounmap(atir->pci_addr_lin); err_free: pci_set_drvdata(pdev, NULL); kfree(atir); @@ -158,6 +160,7 @@ static void atir_pci_remove(struct pci_dev *pdev) struct atir_device *atir = pci_get_drvdata(pdev); lirc_unregister_driver(atir->minor); + iounmap(atir->pci_addr_lin); pci_set_drvdata(pdev, NULL); kfree(atir); }