From patchwork Tue Jul 25 01:13:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9860999 X-Patchwork-Delegate: kvalo@adurom.com 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 7C9E36038C for ; Tue, 25 Jul 2017 01:18:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F29F283BF for ; Tue, 25 Jul 2017 01:18:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6449E285A2; Tue, 25 Jul 2017 01:18: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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 F1FD8283BF for ; Tue, 25 Jul 2017 01:18:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932319AbdGYBSK (ORCPT ); Mon, 24 Jul 2017 21:18:10 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:33353 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756757AbdGYBOT (ORCPT ); Mon, 24 Jul 2017 21:14:19 -0400 Received: by mail-pg0-f45.google.com with SMTP id g14so15187924pgu.0 for ; Mon, 24 Jul 2017 18:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Je0+OTn83yjMvSCgFEh9BrGj2OYHDJX0oAeGOxDGh04=; b=SqWRp51wdP8Vgj86QCQmDaTcPqWDekcilvftTLVmpZ582wfdcc7r8yeS58uZzgeB3w GzX2jCZZQw+gYhpcoMlBr6KfznYjGDjLiT4zydo3K8R0yTGkKDW/hroAXfd+bjOkrVyc m52GVNkSbZgf/BIl352eDGXJvg9CWFGKeQY4M= 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:in-reply-to :references; bh=Je0+OTn83yjMvSCgFEh9BrGj2OYHDJX0oAeGOxDGh04=; b=hwpVMDdkUUVcWg3Y8z4nlbzII3a/ebOQUaXm04pW8xto5us5fgAWES14OV1cm9ZOcO KeY3oZknpo/L1tpirvsz3/dNbLmyEdPvSrbCVrIejBq2nsz8YWRofiJjR2ZxJBxATG9J qQRRsjiKLPTyggsoMuFWSGo3yPfgL0GbUw5wWXYpyorhab+SflLgm0ficMzzcDGAGumY i58D+6L9nAknNdc8T+6TF4rJJU3P0ffZW9tkktSDogyKeTKuH7kpdHe+4LvLUDyN3p2Q WjNX1gYnbkj0IU+S/F7QOtNP03GbbXt55LQ89tNkrvtw323FGTGyK6aXqiru0jjW3dxI Pxnw== X-Gm-Message-State: AIVw111tdmR2NlO+wfKgQEmE93n/PEhWam5DkcDZYHMhcylNZ6Wk0lwC RPl4zfH42BQj9dZDPzEjRcNS X-Received: by 10.99.38.134 with SMTP id m128mr17572058pgm.327.1500945259283; Mon, 24 Jul 2017 18:14:19 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id h123sm21497036pgc.36.2017.07.24.18.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Jul 2017 18:14:18 -0700 (PDT) From: Brian Norris To: Ganapathi Bhat , Nishant Sarmukadam Cc: , Dmitry Torokhov , Amitkumar Karwar , Kalle Valo , linux-wireless@vger.kernel.org, Brian Norris Subject: [PATCH v2 09/20] mwifiex: fix misnomers in mwifiex_free_lock_list() Date: Mon, 24 Jul 2017 18:13:25 -0700 Message-Id: <20170725011336.99993-10-briannorris@chromium.org> X-Mailer: git-send-email 2.14.0.rc0.284.gd933b75aa4-goog In-Reply-To: <20170725011336.99993-1-briannorris@chromium.org> References: <20170725011336.99993-1-briannorris@chromium.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Despite the name (and meticulous comments), this function frees no memory and does not touch any locks. All it does is "delete" the list heads -- which just means they'll be dangling, and we'll need to re-init them if we use them again. It seems like this code would work OK as a sort of canary for using the list after we've torn everything down, so it's fine to keep the code; let's just get the name and comments to match what's actually happening. Signed-off-by: Brian Norris --- new in v2; noticed when bugfixing/reworking other parts of this series --- drivers/net/wireless/marvell/mwifiex/init.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index de96675e43d5..de974e8bb9c6 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -373,15 +373,13 @@ void mwifiex_stop_net_dev_queue(struct net_device *netdev, } /* - * This function releases the lock variables and frees the locks and - * associated locks. + * This function invalidates the list heads. */ -static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) +static void mwifiex_invalidate_lists(struct mwifiex_adapter *adapter) { struct mwifiex_private *priv; s32 i, j; - /* Free lists */ list_del(&adapter->cmd_free_q); list_del(&adapter->cmd_pending_q); list_del(&adapter->scan_pending_q); @@ -422,8 +420,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter) void mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter) { - /* Free lock variables */ - mwifiex_free_lock_list(adapter); + mwifiex_invalidate_lists(adapter); /* Free command buffer */ mwifiex_dbg(adapter, INFO, "info: free cmd buffer\n");