From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 241AB338F45; Wed, 3 Dec 2025 15:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764777406; cv=none; b=cC/nLWYcCHhyH8xCcTEsbjVUqBnTPyCs3C1I5HlD3aEqjxnw+n6W0gfxH4rjX8uxJL6OjBnV+sBTW0j8o6pCN26dV5OGJj++9rEVEfc7J1L/xqaRsV+zJWszMALyfvtPug1LdQXLRql7udWHmdWRMQusbiuJugjeLTI/EhZnM4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764777406; c=relaxed/simple; bh=uKc1eoj7EMDDsO11f4dhZOnuemptp7Hg2tu3p+V1bds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=szrgj2VEbRu3NVNn6vpaoRQjmFheWWBrGFbtybMmB03M1g0NK4VqFP3XdX7vrmQeszqTo9TR4fIrOJKw1DIwTKLMQbpscqZQvPrOF+zrr1p+FbBdVyGMxwX7t1B3tL3pCeJn/Jh3uJJa/CGZTHLczRUcm1LlUYveXOS50ci71+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CsqPnuDp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CsqPnuDp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 448F9C4CEF5; Wed, 3 Dec 2025 15:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764777405; bh=uKc1eoj7EMDDsO11f4dhZOnuemptp7Hg2tu3p+V1bds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CsqPnuDptAr9dXhgYmLdgsHVT5/yXG6pjH6ZsXISgk4zW2hRel9JXggx5h7uAkFdp sW6CQzSmciyF+IZK+pNXsnvG4iBuhTkuFr7S84lCg8UcJOPUUFdl7mPTVVSsaOec6N RekEDjhgTcvU1fv0wQcMmgqlqCVsHDom8O53aoIo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miaoqian Lin , Jakub Kicinski Subject: [PATCH 5.15 007/392] net: usb: asix_devices: Check return value of usbnet_get_endpoints Date: Wed, 3 Dec 2025 16:22:37 +0100 Message-ID: <20251203152414.364262442@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152414.082328008@linuxfoundation.org> References: <20251203152414.082328008@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miaoqian Lin commit dc89548c6926d68dfdda11bebc1a5258bc41d887 upstream. The code did not check the return value of usbnet_get_endpoints. Add checks and return the error if it fails to transfer the error. Found via static anlaysis and this is similar to commit 07161b2416f7 ("sr9800: Add check for usbnet_get_endpoints"). Fixes: 933a27d39e0e ("USB: asix - Add AX88178 support and many other changes") Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters") Cc: stable@vger.kernel.org Signed-off-by: Miaoqian Lin Link: https://patch.msgid.link/20251026164318.57624-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/asix_devices.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -230,7 +230,9 @@ static int ax88172_bind(struct usbnet *d int i; unsigned long gpio_bits = dev->driver_info->data; - usbnet_get_endpoints(dev,intf); + ret = usbnet_get_endpoints(dev, intf); + if (ret) + goto out; /* Toggle the GPIOs in a manufacturer/model specific way */ for (i = 2; i >= 0; i--) { @@ -745,7 +747,9 @@ static int ax88772_bind(struct usbnet *d dev->driver_priv = priv; - usbnet_get_endpoints(dev, intf); + ret = usbnet_get_endpoints(dev, intf); + if (ret) + return ret; /* Maybe the boot loader passed the MAC address via device tree */ if (!eth_platform_get_mac_address(&dev->udev->dev, buf)) { @@ -1165,7 +1169,9 @@ static int ax88178_bind(struct usbnet *d int ret; u8 buf[ETH_ALEN] = {0}; - usbnet_get_endpoints(dev,intf); + ret = usbnet_get_endpoints(dev, intf); + if (ret) + return ret; /* Get the MAC address */ ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0);