From patchwork Tue Jun 1 14:35:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 103549 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o51EaFFd016775 for ; Tue, 1 Jun 2010 14:36:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756962Ab0FAOfX (ORCPT ); Tue, 1 Jun 2010 10:35:23 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:44770 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756510Ab0FAOfU (ORCPT ); Tue, 1 Jun 2010 10:35:20 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 2F74D19BBF2; Tue, 1 Jun 2010 16:35:20 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14383-07; Tue, 1 Jun 2010 16:35:15 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw2.diku.dk (Postfix) with ESMTP id 9EC3019BB9A; Tue, 1 Jun 2010 16:35:15 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 0D9746DFBF1; Tue, 1 Jun 2010 16:27:42 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id 83CBA200BD; Tue, 1 Jun 2010 16:35:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 7EE15200BC; Tue, 1 Jun 2010 16:35:15 +0200 (CEST) Date: Tue, 1 Jun 2010 16:35:15 +0200 (CEST) From: Julia Lawall To: Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 4/4] drivers/hid: introduce missing kfree Message-ID: MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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]); Tue, 01 Jun 2010 14:36:15 +0000 (UTC) diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c index e05d48e..f6e80c7 100644 --- a/drivers/hid/hid-roccat.c +++ b/drivers/hid/hid-roccat.c @@ -168,7 +168,7 @@ static int roccat_open(struct inode *inode, struct file *file) printk(KERN_EMERG "roccat device with minor %d doesn't exist\n", minor); error = -ENODEV; - goto exit_unlock; + goto exit_err; } if (!device->open++) { @@ -178,7 +178,7 @@ static int roccat_open(struct inode *inode, struct file *file) PM_HINT_FULLON); if (error < 0) { --device->open; - goto exit_unlock; + goto exit_err; } } error = device->hid->ll_driver->open(device->hid); @@ -187,7 +187,7 @@ static int roccat_open(struct inode *inode, struct file *file) device->hid->ll_driver->power(device->hid, PM_HINT_NORMAL); --device->open; - goto exit_unlock; + goto exit_err; } } @@ -202,6 +202,9 @@ exit_unlock: mutex_unlock(&device->readers_lock); mutex_unlock(&devices_lock); return error; +exit_err: + kfree(reader); + goto exit_unlock; } static int roccat_release(struct inode *inode, struct file *file)