From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC4BC329E57; Fri, 6 Mar 2026 08:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772787135; cv=none; b=KMWP3CY7p/oUTNcXBLc8GnusXM2nND7lSYQpbpHhZov1z8OuOi8F4QcjGFtjF+ry5eDd+TPin+zXXb3wv3KEmS8nFyNK3rIi59iwMreAHs91tNE8NzL1WODU+boeDsN+juoImrDgp+4zUshhOWMgo7pZyBYJfPnTjGSnVdAw53A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772787135; c=relaxed/simple; bh=+n2gwwI5ICbPV5XOVnFHvtm0RnUfCoQpce3aU1BVfTM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Al6gtFa6TLWdzSAIkhkclqK19T21mtDcZSi2AoZWX5IH7hdOvK8HyUNIs9YYzaxSHPLacTE/bn9MGKYsNQoEOeGVLIo2tnhvTV/o3VDxIp+V0y7MjZCPPpqPR2ZAlaHnLpGZmuETxAtoD/X6sDrKvwbbTLCv28evz2TBs9SSE4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HTZBBKZt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HTZBBKZt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75B7CC4AF0B; Fri, 6 Mar 2026 08:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772787135; bh=+n2gwwI5ICbPV5XOVnFHvtm0RnUfCoQpce3aU1BVfTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HTZBBKZtuSCAj2lJF5fx0z3B+G2qxYh7V/TS0bw6J9UfmOlMedNp+p5WqFoWwMdbc JWtz1eS7zYpFaIOWdcPEcGIrulFjnnH0uPHrCfizZzxENov9uR7j/5aZLM4zWtsrmt 4axX6JrODte7fw1LT8QpcXf4+CVfU7ppf+sVBdrwrPILdqIgncHoDV/02GAJfZf9qv GaB8SxL1RarkA8hD1F16VzvRnmuTmiQdErUuqy22WowYBiVC0IdVvJPNXtK78l0fxH JQhENdv4J2sR90Jj8hs1mXs9CNWfWiRcanfx/3MPv/rJk7j1OBZSSeB7PCT+cbJyNE lkIhLYUspGxFQ== Received: from johan by xi.lan with local (Exim 4.98.2) (envelope-from ) id 1vyQuq-000000003Ab-3lpS; Fri, 06 Mar 2026 09:52:12 +0100 From: Johan Hovold To: linux-wireless@vger.kernel.org Cc: Jeff Johnson , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Brian Norris , Francesco Dolcini , Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Jakub Kicinski , Stanislaw Gruszka , Hin-Tak Leung , Jes Sorensen , Ping-Ke Shih , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Matthias Brugger , AngeloGioacchino Del Regno , Greg Kroah-Hartman , libertas-dev@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 09/18] wifi: mwifiex: drop redundant device reference Date: Fri, 6 Mar 2026 09:51:35 +0100 Message-ID: <20260306085144.12064-10-johan@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260306085144.12064-1-johan@kernel.org> References: <20260306085144.12064-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Driver core holds a reference to the USB interface and its parent USB device while the interface is bound to a driver and there is no need to take additional references unless the structures are needed after disconnect. Drop the redundant device reference to reduce cargo culting, make it easier to spot drivers where an extra reference is needed, and reduce the risk of memory leaks when drivers fail to release it. Signed-off-by: Johan Hovold --- drivers/net/wireless/marvell/mwifiex/usb.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c index 947ecb0a7b40..f4b94a1054f6 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.c +++ b/drivers/net/wireless/marvell/mwifiex/usb.c @@ -520,8 +520,6 @@ static int mwifiex_usb_probe(struct usb_interface *intf, return ret; } - usb_get_dev(udev); - return 0; } @@ -666,8 +664,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf) mwifiex_dbg(adapter, FATAL, "%s: removing card\n", __func__); mwifiex_remove_card(adapter); - - usb_put_dev(interface_to_usbdev(intf)); } static void mwifiex_usb_coredump(struct device *dev) -- 2.52.0