From patchwork Fri Jun 3 22:33:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 9154197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1284D60221 for ; Fri, 3 Jun 2016 22:35:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04F9C2833C for ; Fri, 3 Jun 2016 22:35:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE05828346; Fri, 3 Jun 2016 22:35:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00E7D2833C for ; Fri, 3 Jun 2016 22:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752832AbcFCWe5 (ORCPT ); Fri, 3 Jun 2016 18:34:57 -0400 Received: from mail.ispras.ru ([83.149.199.45]:58852 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752130AbcFCWe4 (ORCPT ); Fri, 3 Jun 2016 18:34:56 -0400 Received: from localhost.localdomain (ppp85-140-189-20.pppoe.mtu-net.ru [85.140.189.20]) by mail.ispras.ru (Postfix) with ESMTPSA id B43C0540091; Sat, 4 Jun 2016 01:34:40 +0300 (MSK) From: Alexey Khoroshilov To: Hans Verkuil , Mauro Carvalho Chehab Cc: Alexey Khoroshilov , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] [media] radio-maxiradio: fix memory leak when device is removed Date: Sat, 4 Jun 2016 01:33:06 +0300 Message-Id: <1464993186-9329-1-git-send-email-khoroshilov@ispras.ru> 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-Virus-Scanned: ClamAV using ClamSMTP Memory allocated for maxiradio device is not deallocated when the device is removed. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/radio/radio-maxiradio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 70fd8e80198a..8253f79d5d75 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -183,6 +183,7 @@ static void maxiradio_remove(struct pci_dev *pdev) outb(0, dev->io); v4l2_device_unregister(v4l2_dev); release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); + kfree(dev); } static struct pci_device_id maxiradio_pci_tbl[] = {