From patchwork Tue Nov 14 13:45:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10057669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69C956023A for ; Tue, 14 Nov 2017 13:46:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EAB42972F for ; Tue, 14 Nov 2017 13:46:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 435DA297B7; Tue, 14 Nov 2017 13:46:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDA192972F for ; Tue, 14 Nov 2017 13:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754320AbdKNNqM (ORCPT ); Tue, 14 Nov 2017 08:46:12 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:50297 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753745AbdKNNqL (ORCPT ); Tue, 14 Nov 2017 08:46:11 -0500 Received: by mail-pf0-f194.google.com with SMTP id u70so9652902pfa.7; Tue, 14 Nov 2017 05:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KfHKBHM/YP/d6KWgnRGZiIqRLLk7cB1irvktDr7hGDI=; b=U0UUGrtFtJ5Zf43g3Zy+PgFXKNZT06qBbvVNWhdsCTyB/e4RPUiW5wy+g0PKPo2nHb MKYAX754aRSsZdfJ0vHVSNWjsqFTZKkUxU6CxwRfbTX19wVaufJVTmLV2O8ctGLguVRV zn07LcH1Zeqvf/LGkhS0Rbw32gUqsN4ZPGmHR1wfDhWMkvfAYbYV9cKjX6Pxa3XqNMDP DaI21d9kFFSb28BxdmUC9tqPsRQNP4wugfndeCGlAs4GijtvXW9K0K87VlP950BNeJMm 9TiIHraa4U6s86nbpcJpQuduZvmNc7xhUMZRouQSzHDuEZwE1ADG7YuXVNu4YX0d9/b1 AzHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KfHKBHM/YP/d6KWgnRGZiIqRLLk7cB1irvktDr7hGDI=; b=VCjRb9ihD/0g+YXiUIW6Mw8a/MMdnv7xIsOaP3eqtkpjQKCK/c7hjjsASWBLMXhUE2 LgqZtuNnB4epP0Bljwsjq5rt3juIv4hepUn/a2Rfr3vGonr/dOJ2CUWCOh5hF4ly/otE 0QYkK/ZE05D3OfnY6RlFjJgde+T2DEs2lktplafdDNGAZxbzOJMFuwXg0UGLonhvc8Mi 1vjLFNNE5oYBLtvDyAK7X1BxIrp8TfgvfCNhK98ZZereEZZmMkeJF9oQ7niT4Uvap9VM BDHQc+3kQ10fIcpbiNSZB8N+mNiVovm/OP+zxwu3kYUb7AOXnLEh05KO6BaTsKYn9zM4 38Tg== X-Gm-Message-State: AJaThX6BRZUknjE9paWLwi/vreEjjScPzSWUspNGD+PofxBu3dN3sYhC sG83TVqKWNfOnM9y8BMib0XQMA== X-Google-Smtp-Source: AGs4zMY5HGnjwlbXzr2/1WBudGIQjaQWBMP5Qjz3kFO8h9SrdN0vm9Gic7ZDfjFddsTR7rPAGfY1Bw== X-Received: by 10.101.74.199 with SMTP id c7mr11918023pgu.169.1510667170838; Tue, 14 Nov 2017 05:46:10 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id z6sm39701349pfe.170.2017.11.14.05.46.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Nov 2017 05:46:09 -0800 (PST) From: Arvind Yadav To: dmitry.torokhov@gmail.com, linux@roeck-us.net Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH] Input: davinci_keyscan: Free memory occupied by davinci key scan device Date: Tue, 14 Nov 2017 19:15:14 +0530 Message-Id: <9203eaebf020cbebf5224221d789a0163490d654.1510666872.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Here, key_dev is NULL in input_free_device() and It will not free memory occupied by davinci key scan device. Move "key_dev = NULL" after input_free_device(). Signed-off-by: Arvind Yadav --- drivers/input/keyboard/davinci_keyscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c index b20a5d0..22cb8d2 100644 --- a/drivers/input/keyboard/davinci_keyscan.c +++ b/drivers/input/keyboard/davinci_keyscan.c @@ -290,13 +290,13 @@ static int __init davinci_ks_probe(struct platform_device *pdev) free_irq(davinci_ks->irq, davinci_ks); fail5: input_unregister_device(davinci_ks->input); - key_dev = NULL; fail4: iounmap(davinci_ks->base); fail3: release_mem_region(davinci_ks->pbase, davinci_ks->base_size); fail2: input_free_device(key_dev); + key_dev = NULL; fail1: kfree(davinci_ks);