From patchwork Wed Jul 20 07:52:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 990402 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6K7cKap000625 for ; Wed, 20 Jul 2011 07:57:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231Ab1GTHw6 (ORCPT ); Wed, 20 Jul 2011 03:52:58 -0400 Received: from mail-gx0-f174.google.com ([209.85.161.174]:34046 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115Ab1GTHw5 (ORCPT ); Wed, 20 Jul 2011 03:52:57 -0400 Received: by gxk21 with SMTP id 21so2140293gxk.19 for ; Wed, 20 Jul 2011 00:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=iMhYiJGbKMfrIhugETP3tbuBrzDiL6hF+lwgS4pgt7Q=; b=snBheNeKrFTXTJ8mBV9/TH/NrpymTduEW1NGsgQN15eBhGTrSy5nS+UNP460/SWMga qlnKkjiPKO6MJtyA5zRwORnn7zZodWNio7m/v3toegVggvadzKVLGxdWT73BaqxP+3Oc xlSqhK2G4zNOYSV1CJcKIeCQrbDO7lQFl5ZrQ= Received: by 10.236.183.166 with SMTP id q26mr11100561yhm.87.1311148377027; Wed, 20 Jul 2011 00:52:57 -0700 (PDT) Received: from [218.172.238.179] (218-172-238-179.dynamic.hinet.net [218.172.238.179]) by mx.google.com with ESMTPS id o47sm4733222yhn.30.2011.07.20.00.52.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jul 2011 00:52:56 -0700 (PDT) Subject: [PATCH] Input: tegra-kbc - correct call to input_free_device From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Rakesh Iyer , linux-input@vger.kernel.org Date: Wed, 20 Jul 2011 15:52:52 +0800 Message-ID: <1311148372.10091.3.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Jul 2011 08:14:50 +0000 (UTC) This error handling code can be reached before kbc->idev is initialized, so it is safer to always use the original name, input_dev. Signed-off-by: Axel Lin --- drivers/input/keyboard/tegra-kbc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 2b3b73e..8e40f2b 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -701,7 +701,7 @@ err_iounmap: err_free_mem_region: release_mem_region(res->start, resource_size(res)); err_free_mem: - input_free_device(kbc->idev); + input_free_device(input_dev); kfree(kbc); return err;