From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754929Ab1G2GK1 (ORCPT ); Fri, 29 Jul 2011 02:10:27 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:58930 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847Ab1G2GK0 (ORCPT ); Fri, 29 Jul 2011 02:10:26 -0400 Date: Fri, 29 Jul 2011 09:08:22 +0300 From: Dan Carpenter To: Jesper Juhl Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Jarod Wilson , Jerome Brock , Andy Walls , Mauro Carvalho Chehab , Gerd Knorr , Jarod Wilson , Greg Kroah-Hartman , Thomas Reitmayr , Michal Kochanowicz , Christoph Bartelmus , Mark Weaver , Ulrich Mueller , Stefan Jahn Subject: Re: [PATCH] staging; lirc, zilog: put_ir_rx may free 'rx' which can lead to double free Message-ID: <20110729060822.GF3752@shale.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 28, 2011 at 11:49:51PM +0200, Jesper Juhl wrote: > If calling put_ir_rx(rx, true); in > drivers/staging/lirc/lirc_zilog.c::ir_probe() returns true (1) then it > means that it has freed it's first argument. Subsequently jumping to > 'out_put_xx' will cause us to call put_ir_rx() once more since 'rx' is > not zero - leading to a double free. It would be better to just remove the first call to put_ir_rx(). regards, dan carpenter