From patchwork Thu Aug 12 07:47:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 119207 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7C7lpEu025135 for ; Thu, 12 Aug 2010 07:47:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758645Ab0HLHrs (ORCPT ); Thu, 12 Aug 2010 03:47:48 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:50267 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754369Ab0HLHrr (ORCPT ); Thu, 12 Aug 2010 03:47:47 -0400 Received: by wyb32 with SMTP id 32so1082818wyb.19 for ; Thu, 12 Aug 2010 00:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=DQoG0P1Cr9ERXAldLn+gTb4DJ0L3cFozf2g1SPBGMnQ=; b=AVeqRp57SjaImGtt2hCM91sFEVaB9uNYJ4ULsMldz9YYGl5uLcCRwNshytfS2rBzQA XFHrD7g4N+b+815KzfRK2CwxcOMK2z/OjKlJYYJofqkz7FUBrZ52jdNxRFHvX2UcgIuI TcI/sKNL5zZfHSLXPjgXtc5aZkpqYCkl7DU5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=Hosldm+muyzrW8OYuhAkzwzCnhE/kyK99mgUTW1odi1eM4/ROgXubId2l9o8AzojjL YwYET73fHcTzQ8PTNd9hU/R/JSbRD58eED02WEmXxhwIWcehdfvJzTzeVSEh+yekdXna yOXrhooKgQqgO0upGGrhPKMkbStLLYg42RxNU= Received: by 10.227.134.144 with SMTP id j16mr17431511wbt.50.1281599266262; Thu, 12 Aug 2010 00:47:46 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id j1sm619338wej.15.2010.08.12.00.47.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 12 Aug 2010 00:47:45 -0700 (PDT) Date: Thu, 12 Aug 2010 09:47:07 +0200 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: David =?iso-8859-1?Q?H=E4rdeman?= , Jarod Wilson , Maxim Levitsky , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] IR: ir-raw-event: null pointer dereference Message-ID: <20100812074707.GJ645@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 12 Aug 2010 07:47:54 +0000 (UTC) diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c index 43094e7..8e0e1b1 100644 --- a/drivers/media/IR/ir-raw-event.c +++ b/drivers/media/IR/ir-raw-event.c @@ -279,9 +279,11 @@ int ir_raw_event_register(struct input_dev *input_dev) "rc%u", (unsigned int)ir->devno); if (IS_ERR(ir->raw->thread)) { + int ret = PTR_ERR(ir->raw->thread); + kfree(ir->raw); ir->raw = NULL; - return PTR_ERR(ir->raw->thread); + return ret; } mutex_lock(&ir_raw_handler_lock);