From patchwork Thu Sep 13 05:25:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 1450161 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@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 4B490402E1 for ; Thu, 13 Sep 2012 05:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755541Ab2IMFZm (ORCPT ); Thu, 13 Sep 2012 01:25:42 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:37076 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412Ab2IMFZU (ORCPT ); Thu, 13 Sep 2012 01:25:20 -0400 Received: by obbuo13 with SMTP id uo13so3929798obb.19 for ; Wed, 12 Sep 2012 22:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version; bh=ukIsGxFo3eCi70PI/x+WNNTqp05qGkN3f+btJN4wc14=; b=J0hB6AsUDbTUK1z3rul37vITr+LWwQemOIR29KOAP0R4sJYSvNR8/y8FP+J3hfq8AC s5yLK9cI2W3zzvFm/xXvS0NFLIYMYC2ISQPaV03PGA9xUimC+3UD5s711M3zGLZqBgeu f9ZdUN4TA9p3mkEeqgBD2cBxFCv5BNcTpbDUPCa1pcooTdLm6fgY8IieROCYTEZTK4WC bJ556ZKwtn7EmR/BjHq9SPkknGBI5YuvCuN57mRg5y5ZZqnV2L7y8QY2Da6HyGoq3WyQ IlxyYo/bT15YE7xr6Y0HKnG5260hDNYzjcPwE1GJrxuGEZrDLaM+MkSerJKe2imKqREE MQRQ== Received: by 10.60.19.169 with SMTP id g9mr610692oee.97.1347513919976; Wed, 12 Sep 2012 22:25:19 -0700 (PDT) Received: from [218.173.173.81] (218-173-173-81.dynamic.hinet.net. [218.173.173.81]) by mx.google.com with ESMTPS id b5sm307442obd.18.2012.09.12.22.25.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 22:25:19 -0700 (PDT) Message-ID: <1347513912.3319.1.camel@phoenix> Subject: [PATCH] HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp() From: Axel Lin To: Jiri Kosina Cc: Bernhard Seibold , linux-input@vger.kernel.org Date: Thu, 13 Sep 2012 13:25:12 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org We need to kfree names for led_mute and led_micmute in tpkbd_remove_tp(). Signed-off-by: Axel Lin Acked-by: Bernhard Seibold --- drivers/hid/hid-lenovo-tpkbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hid/hid-lenovo-tpkbd.c b/drivers/hid/hid-lenovo-tpkbd.c index 77d2df0..60c4e1e 100644 --- a/drivers/hid/hid-lenovo-tpkbd.c +++ b/drivers/hid/hid-lenovo-tpkbd.c @@ -519,6 +519,8 @@ static void tpkbd_remove_tp(struct hid_device *hdev) led_classdev_unregister(&data_pointer->led_mute); hid_set_drvdata(hdev, NULL); + kfree(data_pointer->led_micmute.name); + kfree(data_pointer->led_mute.name); kfree(data_pointer); }