Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3490909pxf; Mon, 29 Mar 2021 03:51:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn+VvlMhEu9aYUGyVX61OrtPdtCU10w/TKgQBccEOoLOQla6sGG1FeDM55CvFouK+uWR+h X-Received: by 2002:a17:907:33cd:: with SMTP id zk13mr27793324ejb.224.1617015097600; Mon, 29 Mar 2021 03:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617015097; cv=none; d=google.com; s=arc-20160816; b=IxA870rseEU8+CTWiOIwYzBXsjDiPXg6dH/dUxw/26OVxh7hj1Klr4znwEUVMbsTlw 5Ca0u1+dCZJbUU5gX10SwWuQOwVJkeojWKE3R4JZmF8pGHuerFroIhRnG8KXaHTwKa15 otZjj33TKU8I8pJbVTBsFpuLynxX5i9lGIpl0zsAjTC+AePGAvvqvewsMFD24h3PBUeE +klL2CjpVOQKGE+GD6KF0Rng6iwziYKjYTVKpvoAUykw8xr4AQ/Lv98i2XfppGDLVO1H kqClJ7japBN/++eVE6gHeeStxqRHM+kY9Qu5GVcvidfgRYjbKWP1c07Jvm+E0+f3AHm4 M8zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lOycuxOxLVrAETXZeZgYi8/lN0uwW35Sjrsy2i8J8l4=; b=OxqgjvZHicaxktFnTLKMW+5hzTWvpKVwyEbm3sdx0uZYxG02Ghrrsky8HnPU2e0nPE MLjIDaClFRvI/mE9PTe4uRhE4MPELCU1YCOhXDAp9XlWwu2K7/whWR2sWu2i7Y6+eZYM S+idKUdHuTq3v6IbpLXKBf43BsiasavqzEt4LVmXDSUD1pW2gyzfUAv8OdBFBAU6rpLH BoAOJXBHUKAiVBN8qzwXPch1q3R1PgXPLChHogJFVF5F5Lv/i0QrPNA45/fHDonAhJej jlPNbNUbdD5rjEhJWB5vXTfHPaKI2YbEcMGhePTgUY86tKfkMbf0ZvsMhi8WknGRmzoT U32g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jhb9PUEF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id go39si11806713ejc.260.2021.03.29.03.51.14; Mon, 29 Mar 2021 03:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jhb9PUEF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232568AbhC2Ijc (ORCPT + 99 others); Mon, 29 Mar 2021 04:39:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:40836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233248AbhC2IX0 (ORCPT ); Mon, 29 Mar 2021 04:23:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E0C661477; Mon, 29 Mar 2021 08:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006205; bh=kkZK/RxSw3+RWBfK4A03XAdjzVdflarD+6HPnAzx1FA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jhb9PUEFaXluob0EYCEuKvsBETavDYcqkqTfSY28z5g4/Np0opsDcvB1A2Ly5ugdc FpFTXEl0sCmi99GiHYTsCIauLbOcoWMOyiXdkpgMjmpd9McLN838dJE4me2KKDQPVJ TW9j7KN48BPzFaSuLAjloPoZRmae67byQ1RdjX8I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 157/221] net: cdc-phonet: fix data-interface release on probe failure Date: Mon, 29 Mar 2021 09:58:08 +0200 Message-Id: <20210329075634.405717303@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold [ Upstream commit c79a707072fe3fea0e3c92edee6ca85c1e53c29f ] Set the disconnected flag before releasing the data interface in case netdev registration fails to avoid having the disconnect callback try to deregister the never registered netdev (and trigger a WARN_ON()). Fixes: 87cf65601e17 ("USB host CDC Phonet network interface driver") Signed-off-by: Johan Hovold Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/cdc-phonet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index dba847f28096..2520421946a6 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -387,6 +387,8 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i err = register_netdev(dev); if (err) { + /* Set disconnected flag so that disconnect() returns early. */ + pnd->disconnected = 1; usb_driver_release_interface(&usbpn_driver, data_intf); goto out; } -- 2.30.1