From patchwork Tue Jan 14 10:01:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F6F8C33CB1 for ; Tue, 14 Jan 2020 10:16:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D7C0207FF for ; Tue, 14 Jan 2020 10:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578996990; bh=t1MVqNJSBHmvZFHC7AaR1jN9CTHzsv73hqiSaQTsSxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Hq8TxeqlRoG6WM5S/c2sFZqrWCc8KrefSzUeQfMLEE6SqXfFUAjRHA90i1JGJHYqe Fz8YS0SUwm9O4L2aLJ7egap524eUm8OyERTPDw7cIBqVOY2AS7rFLJC153Dmo9xpwT SZoaSwefeyOMRyEbPNe2QtUWkb8kYeA6LPAd9i5Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729702AbgANKJd (ORCPT ); Tue, 14 Jan 2020 05:09:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:42386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730950AbgANKJa (ORCPT ); Tue, 14 Jan 2020 05:09:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7838724676; Tue, 14 Jan 2020 10:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578996569; bh=t1MVqNJSBHmvZFHC7AaR1jN9CTHzsv73hqiSaQTsSxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4Wv1OhLrWnYJCXGooLMiVc5QB3VUQbvS5OZtfdCLbT5QzUFxtw3mr5z4Q5ACZkHN JX1O+bxMqEuQ6zPn2ATnIrZk6/8y9fDTGSc+/EtErAOB2mZFpDO/uVnOB7ebvPgAlj xiCRu+1Cyfiu9X+EpmS2xnbt0mrNKEXRwHMo7d58= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Malcolm Priestley Subject: [PATCH 4.14 15/39] staging: vt6656: set usb_set_intfdata on driver fail. Date: Tue, 14 Jan 2020 11:01:49 +0100 Message-Id: <20200114094342.541675810@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114094336.210038037@linuxfoundation.org> References: <20200114094336.210038037@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Malcolm Priestley commit c0bcf9f3f5b661d4ace2a64a79ef661edd2a4dc8 upstream. intfdata will contain stale pointer when the device is detached after failed initialization when referenced in vt6656_disconnect Provide driver access to it here and NULL it. Cc: stable Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/6de448d7-d833-ef2e-dd7b-3ef9992fee0e@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6656/device.h | 1 + drivers/staging/vt6656/main_usb.c | 1 + drivers/staging/vt6656/wcmd.c | 1 + 3 files changed, 3 insertions(+) --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -269,6 +269,7 @@ struct vnt_private { u8 mac_hw; /* netdev */ struct usb_device *usb; + struct usb_interface *intf; u64 tsf_time; u8 rx_rate; --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -954,6 +954,7 @@ vt6656_probe(struct usb_interface *intf, priv = hw->priv; priv->hw = hw; priv->usb = udev; + priv->intf = intf; vnt_set_options(priv); --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -109,6 +109,7 @@ void vnt_run_command(struct work_struct if (vnt_init(priv)) { /* If fail all ends TODO retry */ dev_err(&priv->usb->dev, "failed to start\n"); + usb_set_intfdata(priv->intf, NULL); ieee80211_free_hw(priv->hw); return; }