Received: by 2002:a05:7208:1509:b0:82:bbfa:f723 with SMTP id o9csp219586rbf; Wed, 24 Apr 2024 00:00:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVE+DfQWoPqi1So2UEOctVolCKtd/eZ2b1i/cgsETJhMu43l7CdFA3I49I8V2xPcTg4fJ6Rt7URECJIflfREnVklsFhjFZD+OjnZ98Jew== X-Google-Smtp-Source: AGHT+IHE72mIVLSJ393wOiA1OBduXBC4z0uosxEQtwzSoAyqZM1rhQiM8+hqQrjBTiGMCGzAzZHN X-Received: by 2002:a05:651c:102a:b0:2d8:1d29:23a8 with SMTP id w10-20020a05651c102a00b002d81d2923a8mr828908ljm.29.1713942015179; Wed, 24 Apr 2024 00:00:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713942015; cv=pass; d=google.com; s=arc-20160816; b=1Bsc6IF9XVx2u1vCP2iQ/SIVr30B/cWWY2n8r7v6bPJoy/jr4Ai9pba9rNDNlwYeeh a/PQZ1dLPcvqnZgBWcPqlBCTey3suLuCkHKhyikEtIC43Tg624M5O1Sv31Hlcyg52pmP zFRdVqdgtWwxE5fkGRNgqJjgQ1ZbOFCTYGFf6SWsfxyNPBsvmxySv/4AReHWtO0Yh48/ KybfGQA6wmgUeoadrEDV3VfUg7ww0/f9x718lHLjs9/ydFvH+qaGout6ViXdT1epVFwT WuIxThLxiYsk4ux7dqCPbiHf/8UcxtqAi76z4+4PrF2mb/hKatwynCfFuSU//3XUZQJA hL5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=DjKTLb/Hzmerf/tiPBtGXwro+rqebqKp1eua6xwlMow=; fh=5lIrx0HxwBv7JBF5l3o+ZfhQqg3Y4XfJ038wgKByVio=; b=aopRzIGKOiYDxerspk8EuhWz1U/FLkRJHbDZy2sOn/UxICQUR4P+OY9onz1bULl9a0 f+4wewTt7qjagQEngIDUfHKyembHMPOj1lR6ewRQhuqg94L5xBNQffLOG2A6eQdba3s2 d1VCVewWb7BusLjnS7e1N8ackRHmrNmy6CPdy8mE56qWcuVf4FTJM74VOoOdxXhzYZrT 3GGgWcxwaW1vp5cUzybWp2gX8g7d/aqsmENUKgdqHcIzLVWufXio8IUreprL5OoHZF0S ZJXhqZsk+wuztfnrrOPPOwJXPgiOW5IesknJDTDmQlxvF2Lnvcwm14bz+ypCNx6zjKD8 Up8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=AukXqEkZ; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-156434-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y15-20020aa7cccf000000b0057016a97b00si7945749edt.465.2024.04.24.00.00.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 00:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156434-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=AukXqEkZ; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-156434-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E106F1F2376C for ; Wed, 24 Apr 2024 07:00:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0534115885A; Wed, 24 Apr 2024 06:57:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="AukXqEkZ" Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA497157499; Wed, 24 Apr 2024 06:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713941858; cv=none; b=Lj2PhLk25r9kDzYzNm/Jo0AJC2RaMtLfLy2UpTR9VwBDwmaIILa5UeQFdojZcPkttXL3aRcRv0MUYUQFQh6/icntoNjw5UCWErKPuW8JYrsMedwpD9Jx0MGTVxTXApQmu4SC1JvtLRFeTkH4K+1XDhbQCqUlXm03cHli3HCOAsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713941858; c=relaxed/simple; bh=4M75hS8XdGgB27pG91ABOzG8oYFy2pFxUFNJPq7UJVI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=noAeInJdrzC4ddKq8kdUR20xke6Sp5w/XnJtuB+n49YzXXPL5eCQ0Vsrr84peajgJk36CtyYiLK013I+UpXlnd/UeDBUALnppr+rEMVlHlgV1fzz/ZtcoACcWDr///Skdt5q+uA1rUaX0J7SXYadwWALcjaW1gHgE5cjJN1D8y4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=AukXqEkZ; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=DjKTL b/Hzmerf/tiPBtGXwro+rqebqKp1eua6xwlMow=; b=AukXqEkZJzqCCQMAJju49 Ub8DdX3+R54S7e66piVwKAJXSVYYcblIlUMhfHVKozDGL2PQJFm+N2g2B/EaR0Pm Iv0vZciMqIPLRFakNzhSvBeJ1ij8kSSgLyX6hkTM1+/TErpxjwvDdrZvTG5ZQNkX eeRQ19PZw7izp9vnLN9HaI= Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by gzga-smtp-mta-g2-3 (Coremail) with SMTP id _____wDnFz0krShmD3q+CA--.62207S4; Wed, 24 Apr 2024 14:56:56 +0800 (CST) From: Ma Ke To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jtornosm@redhat.com, andrew@lunn.ch, horms@kernel.org, hkallweit1@gmail.com, make_ruc2021@163.com Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] net: usb: ax88179_178a: Add check for usbnet_get_endpoints() Date: Wed, 24 Apr 2024 14:56:34 +0800 Message-Id: <20240424065634.1870027-1-make_ruc2021@163.com> X-Mailer: git-send-email 2.37.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wDnFz0krShmD3q+CA--.62207S4 X-Coremail-Antispam: 1Uf129KBjvdXoWruw4rZw4UAFy7GrWDury8Xwb_yoWfWrb_u3 Z7Gwn7Wr4jgF48Wr4DGw4avrWfKa1kXwn7uF4kK3sIq3WYq3WDJrn2vrnxC3Z7WF40vFnr Cw1qyFy3JryDtjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRNvtCUUUUUU== X-CM-SenderInfo: 5pdnvshuxfjiisr6il2tof0z/xtbBFRTKC2XAlI2PswABsB To avoid the failure of usbnet_get_endpoints(), we should check the return value of the usbnet_get_endpoints(). Signed-off-by: Ma Ke --- drivers/net/usb/ax88179_178a.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 752f821a1990..388ea178c91d 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1287,8 +1287,11 @@ static void ax88179_get_mac_addr(struct usbnet *dev) static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf) { struct ax88179_data *ax179_data; + int ret; - usbnet_get_endpoints(dev, intf); + ret = usbnet_get_endpoints(dev, intf); + if (ret < 0) + return ret; ax179_data = kzalloc(sizeof(*ax179_data), GFP_KERNEL); if (!ax179_data) -- 2.37.2