From patchwork Sun Apr 26 08:37:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firo Yang X-Patchwork-Id: 6275441 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 903ABBF4A6 for ; Sun, 26 Apr 2015 08:38:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1AD32038F for ; Sun, 26 Apr 2015 08:38:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1E612038C for ; Sun, 26 Apr 2015 08:38:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbbDZIh1 (ORCPT ); Sun, 26 Apr 2015 04:37:27 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:35137 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbbDZIhZ (ORCPT ); Sun, 26 Apr 2015 04:37:25 -0400 Received: by pdbqd1 with SMTP id qd1so95051827pdb.2; Sun, 26 Apr 2015 01:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=oARWzvgcHrbnpV1BEn9cQs4ruzqbZyZx3EIjN6YIneU=; b=NvQv3fQW9PikqDmyV+LEjRxriL/0ABXS+JAYWByUvAezoSSzHwg1cSyHw6MRIv0iNG 6YEZafM7fHRzMK3HHvNu5GGMzmsOuYBGSinkv6ZmLZ18S3nJAv03LrYyK3rhPbH2i7uJ YgCZuhtvY8onEmK0ZDM1VizljPVJf4dk41OpRMTBuhIfhHxdvAipu8KdxCvi40sLBEPq FqisMELVjU4xVJPVxSsoeCfW13h3tbHb+yNC3vYJBeUQsmRE/QjzICV7TfIXw22Fzo5r NUj80FzmOUM1sQZl0js2TUNcQ983Z9TFHITvmqALzYA9Cq1w7iPY5pKPHrrHqwsn302V +/lQ== X-Received: by 10.70.88.170 with SMTP id bh10mr12124777pdb.62.1430037444776; Sun, 26 Apr 2015 01:37:24 -0700 (PDT) Received: from localhost (138.128.195.217.16clouds.com. [138.128.195.217]) by mx.google.com with ESMTPSA id de4sm15826693pbb.95.2015.04.26.01.37.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Apr 2015 01:37:24 -0700 (PDT) From: Firo Yang To: lauro.venancio@openbossa.org Cc: aloisio.almeida@openbossa.org, sameo@linux.intel.com, christophe.ricard@gmail.com, linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org, Firo Yang Subject: [PATCH] NFC: st21nfcb: Remove inappropriate kfree on a devm_kzalloc pointer Date: Sun, 26 Apr 2015 16:37:18 +0800 Message-Id: <1430037438-11617-1-git-send-email-firogm@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since ndev->driver_data is alloced by devm_kzalloc(), we do not need the inappropriate kfree to free it in driver's remove function. Freeing will trigger when driver unloads, so I remove it. Signed-off-by: Firo Yang --- drivers/nfc/st21nfcb/st21nfcb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/nfc/st21nfcb/st21nfcb.c b/drivers/nfc/st21nfcb/st21nfcb.c index ca9871a..c7dc282 100644 --- a/drivers/nfc/st21nfcb/st21nfcb.c +++ b/drivers/nfc/st21nfcb/st21nfcb.c @@ -131,11 +131,8 @@ EXPORT_SYMBOL_GPL(st21nfcb_nci_probe); void st21nfcb_nci_remove(struct nci_dev *ndev) { - struct st21nfcb_nci_info *info = nci_get_drvdata(ndev); - nci_unregister_device(ndev); nci_free_device(ndev); - kfree(info); } EXPORT_SYMBOL_GPL(st21nfcb_nci_remove);