From patchwork Tue Nov 25 14:57:54 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 1658781 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3ED733FDDA for ; Sun, 28 Oct 2012 19:58:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919Ab2J1T6K (ORCPT ); Sun, 28 Oct 2012 15:58:10 -0400 Received: from 1010ds2-suoe.0.fullrate.dk ([90.184.90.115]:15711 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752976Ab2J1T6J (ORCPT ); Sun, 28 Oct 2012 15:58:09 -0400 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 568089403D; Tue, 25 Nov 2008 15:57:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 54B3D9403B; Tue, 25 Nov 2008 15:57:54 +0100 (CET) Date: Tue, 25 Nov 2008 15:57:54 +0100 (CET) From: Jesper Juhl To: Mauro Carvalho Chehab cc: =?ISO-8859-15?Q?Beno=EEt_Th=E9baudeau?= , Trilok Soni , Dan Carpenter , "Du, Changbin" , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] [media] rc: Fix double free in gpio_ir_recv_remove() Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Since rc_unregister_device() frees its argument there's no need to subsequently call rc_free_device() on the same variable - in fact it's a double free bug. Easily fixed by just removing the rc_free_device() call. Signed-off-by: Jesper Juhl --- drivers/media/rc/gpio-ir-recv.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index c698408..fe0941d 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -148,7 +148,6 @@ static int __devexit gpio_ir_recv_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); rc_unregister_device(gpio_dev->rcdev); gpio_free(gpio_dev->gpio_nr); - rc_free_device(gpio_dev->rcdev); kfree(gpio_dev); return 0; }