From patchwork Fri Oct 20 21:06:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 156320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp1325472vqb; Fri, 20 Oct 2023 14:08:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsWWTot2MdcIKXj/Cw3MW1Z9MGh8Thp63yIMjJ2aJTPZblM9j0hL1iXBY0SpW2eWZTmNFw X-Received: by 2002:a05:6a21:7802:b0:171:c88a:8927 with SMTP id be2-20020a056a21780200b00171c88a8927mr2621949pzc.29.1697836124830; Fri, 20 Oct 2023 14:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697836124; cv=none; d=google.com; s=arc-20160816; b=fETiiw6+sDbmr3X7zl55S+jstl8v+jUBp3XHpyHXk7nrVd5DE++3WPwy6MHZPt9WY+ eNjWew1nI8jt17KWkoLwn6gTIXJAEG1Idb4t1FSP1qTaEeycPyWt/t2aDvQ5fr746He0 iPDLyZ2zoSS2Fn0dPoamajCG4iknHf+Pvh6jBQ3nu5X/j6BXulejxDf8GbwEfoWgIe5E zpJ/XbPSo111nky6g5kvmvGcSjruh3Zf0Fwb8K7wOVbIQ4DxheaO8+PCTmSHocAcO5qC isKBtHeC7zDdmGr+Pz40+xK6io7eg+tmkiUxHMA7a7TqxonyIrhmPD3elP0k4h25j15X 9VAw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2t/WxCh6KdH2++1xQE9zOJhNaEepvtTtM2yGGCDnfvM=; fh=zTr+uH2kSs/oKblpwigKoDAJbZw82uLZilNO8W1q+qc=; b=lvkhCiwanNLKow6Z0UtS9AldtFrFgWP/GBmZySyhfmtNUfcFsp7m6i/S6aQzy69RP4 gabBwaylgVJjvkbFCcd/57bfRTJtpOTvcbyiRg79oLVk/a6fQyWzzKxDK7rett6Tr34A feVcX/SctAm8msR+ggukp38zMA0UvcMhRr14PyCqIXvVnxiyk1DhmAaucztvhr14oY3Y g6ye1d8Rk4AQ57+7Xps58e3maapgpAoWZ99PCYxE2QhcbTMjKllt0/yUiMXmdWZ87LbN wMGtqd6QigKZ3QX5pB+mbB31Avnvb7UY1oLv2jsOZEY1cerEb0HD3XhlJwoTIqq3c6sn yGlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IEFc52JD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b00565dd108fd4si2449047pgb.115.2023.10.20.14.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 14:08:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IEFc52JD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4FDA1828789D; Fri, 20 Oct 2023 14:08:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232919AbjJTVIZ (ORCPT + 26 others); Fri, 20 Oct 2023 17:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbjJTVIQ (ORCPT ); Fri, 20 Oct 2023 17:08:16 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37AB7D70 for ; Fri, 20 Oct 2023 14:08:14 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6bee11456baso1143646b3a.1 for ; Fri, 20 Oct 2023 14:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1697836094; x=1698440894; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2t/WxCh6KdH2++1xQE9zOJhNaEepvtTtM2yGGCDnfvM=; b=IEFc52JD4Q0EusatVY/1HZS5odGzw3pdcgghbFuL8C7dZz9bMpAt8OFIye/bzE1xc7 OG8GuYLZ1IeEk56r7RKjr3JM+zQevy1qfrwLKQaOMnH5kKVSHbTXP61KSeYuXvwTkYz1 pImO3djVfbFkkR8tzxbVg5CdzHXW/Ig1rElr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697836094; x=1698440894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2t/WxCh6KdH2++1xQE9zOJhNaEepvtTtM2yGGCDnfvM=; b=wdS0RJI4FBy4uWOxl48oVUBok4XTCCBqskbBrAR8TbRM4uE9vSkVVs/eJ9Lut/Awo3 R4uxiCIGcQRofcp+J29djgeqd3tp/yy/AJYWM7JQGlshpU7Zqr/jtIllBpuW0zQGuNR9 VT9utqUMTZoi6qlbPsYLWmAE2M6UOMYyyuGZIUq50aZi/RZSsai872pGKXzDk2Nah02+ 8QGtJycI3LcWX/PGDD2tCk5hhlJD5OEVb6QMf2YGFjIlAjqqCLxpp+aEfX0HaJyRrIdu ocPFsd6MlVHxwsTtmChyxWX5UpgSrBxmQZDKeheHCFuyLHcqkBnhhfyaGnUT5SF2kpvk Ih0g== X-Gm-Message-State: AOJu0YxhI9JIH93URz0NXicMC4dIYbhDhYSeVyVkxqv4H1cwI+qpVvCR XkPUxmgfL+qmYnhIwjoe1mgPOA== X-Received: by 2002:a05:6a20:548c:b0:159:dccb:8bb4 with SMTP id i12-20020a056a20548c00b00159dccb8bb4mr3477526pzk.23.1697836093673; Fri, 20 Oct 2023 14:08:13 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:c078:ee4f:479f:8486]) by smtp.gmail.com with ESMTPSA id w14-20020aa7954e000000b00686b649cdd0sm1969278pfq.86.2023.10.20.14.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 14:08:13 -0700 (PDT) From: Douglas Anderson To: Jakub Kicinski , Hayes Wang , "David S . Miller" Cc: Edward Hill , Laura Nao , Alan Stern , Simon Horman , linux-usb@vger.kernel.org, Grant Grundler , Douglas Anderson , =?utf-8?q?Bj=C3=B8rn_Mork?= , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v5 2/8] r8152: Run the unload routine if we have errors during probe Date: Fri, 20 Oct 2023 14:06:53 -0700 Message-ID: <20231020140655.v5.2.Ica8e16a84695e787d55e54e291fbf8a28e7f2f7b@changeid> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog In-Reply-To: <20231020210751.3415723-1-dianders@chromium.org> References: <20231020210751.3415723-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 20 Oct 2023 14:08:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780310212338650852 X-GMAIL-MSGID: 1780310212338650852 The rtl8152_probe() function lacks a call to the chip-specific unload() routine when it sees an error in probe. Add it in to match the cleanup code in rtl8152_disconnect(). Fixes: ac718b69301c ("net/usb: new driver for RTL8152") Signed-off-by: Douglas Anderson Reviewed-by: Grant Grundler Reviewed-by: Florian Fainelli --- Changes in v5: - ("Run the unload routine if we have errors during probe") new for v5. drivers/net/usb/r8152.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 482957beae66..201c688e3e3f 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -9783,6 +9783,8 @@ static int rtl8152_probe(struct usb_interface *intf, out1: tasklet_kill(&tp->tx_tl); + if (tp->rtl_ops.unload) + tp->rtl_ops.unload(tp); usb_set_intfdata(intf, NULL); out: free_netdev(netdev);