Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2826637pxb; Mon, 1 Nov 2021 02:38:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv2DFUQY8/M0innhACZFzb+f++9vfkvtd2DeCUrLz/MWTnHjB8dJwfs78KhMIHb2ZyElV6 X-Received: by 2002:a92:de4d:: with SMTP id e13mr15196412ilr.283.1635759484578; Mon, 01 Nov 2021 02:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635759484; cv=none; d=google.com; s=arc-20160816; b=a5AfpAmOCoHWyvp1doPe4Impm44sWLCZCoVe5+7qIBE3Bg9zzYSLGGu5AflMOa33dQ ewjSwx1fC1Rc+H1p+Fh4DthNVTNTE5PAgDgDBda7rKONSGWCN57dgKW73nk6cm24P/LG jYG31AQYAuLfaeroLiMIaOqdH8BxlLqZcAMOwAyPVARy9bAL7uOA1oGEpsi685D39fNF M64il8gBY8vyOjY9IlTK6ILmaPYrjSqH+HMUSrM7ACv50gnj7Ie7igUgGw4yO5GPMfSe TWFvFDztjNmspRND85/lMLtEtLzisRHp7Th6vCFCJLVLgPW/yR/w09YoOEf5rjOp89eC wQHQ== 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=zI3uP6mCJGt91VKOzS72amJB/iiluf3V75GFt6yways=; b=ioLwgXw8CTcl/4++OQnptEefgC57mqw3QC0yp1zo1oAPluj1McObrdWoFIdF1Uxiiv Y5WaT48I8ymKthZbbP1G+eNcouAM3C37KG/d6QFWGoFH5xjRiZsIcGF92+gJGVwVjlPF ZU3bBwifotfyqgS+Jit2lNYUDWLnqLT8tCq+5C0cDl/xcLXOx6q0gx3Ufc9apXGrSlbz I5XBB/xXjwv5LTm6TOn0mFuIb/bAnxjy0nb0PvtnqchQs+d87HxothKKb8ltdJ6VNXIY audxiBAhbCRe1dsNy/Q7GoK6mx2c8lX2XfZiQ3obLkGFtJKZOfYroc6X0Tot1bnyPk7X 0iRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L5rhSziS; 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 x12si9465859ill.167.2021.11.01.02.37.48; Mon, 01 Nov 2021 02:38:04 -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=L5rhSziS; 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 S232934AbhKAJjK (ORCPT + 99 others); Mon, 1 Nov 2021 05:39:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:43768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233303AbhKAJgC (ORCPT ); Mon, 1 Nov 2021 05:36:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA0B261288; Mon, 1 Nov 2021 09:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758784; bh=Wd1TMrG9bhlBcjNM+Eh5nn4puss28CY/8bKP/IUPYmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L5rhSziS/q5hWo2umYJ2ljjzDib9IX3EXSFvvPuQTX+FvbMtewG+jJ8T7KiIEsFs6 TIsrjaw9EQfaLZuk7Ce+3wz33MXG3ryPeg5SqDV+T3thMKGUh/AVi0D1dlrO6ZEK23 OmHTBHgiFOIs/uqH1Ogw5cCTP9xx+TovyOCzdgNw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuiko Oshino , "David S. Miller" Subject: [PATCH 5.10 57/77] net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails Date: Mon, 1 Nov 2021 10:17:45 +0100 Message-Id: <20211101082523.679279513@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082511.254155853@linuxfoundation.org> References: <20211101082511.254155853@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: Yuiko Oshino commit d6423d2ec39cce2bfca418c81ef51792891576bc upstream. The driver needs to clean up and return when the initialization fails on resume. Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Yuiko Oshino Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/microchip/lan743x_main.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -3066,6 +3066,8 @@ static int lan743x_pm_resume(struct devi if (ret) { netif_err(adapter, probe, adapter->netdev, "lan743x_hardware_init returned %d\n", ret); + lan743x_pci_cleanup(adapter); + return ret; } /* open netdev when netdev is at running state while resume.