Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1819526imm; Mon, 3 Sep 2018 10:15:05 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda74HEfog9HCDVaW2R28CbOkxxXGZm3xVgG52rAKBy8vChwYYPIhG6pFldUbMHCSyohSGNX X-Received: by 2002:a17:902:24d:: with SMTP id 71-v6mr21412040plc.91.1535994905062; Mon, 03 Sep 2018 10:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535994905; cv=none; d=google.com; s=arc-20160816; b=gguiVUa8ZWd8n1Adimv4h9nbcQCGRIHSqImoejQkRv3ALpvrWBBWBZKItOWfXCRkhd 8KJohOx2s/ZxgFv3LaDyjYgv6NvJ9YKD4IQ9gb04UEOP8Z/JIOTD+ozFx+86TBGOnL2u JQHdBQvX7XdK1OIOHM6dWtINpzR9tvS0u6NqSbXIITWxG3kFRK1gJQuBTXaAWpj/ijM9 zhPgoMyELgZfuNqOsDDTL3nWbMOkmuurshpiLJfm4Ra3CCMrqlf8x8SJ/lreHRKc6diH f5aHZrtGsZLjHWgYpt1nAbP+ZdYnlmLS8N7Mpe8N5c3hlHq8tNbIUJOh+jtfamzZ+tAi jtmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1WYNK4pjbxIXAjxQB25UGLHBPEU8zIu3b+keUASjhHU=; b=gTp91Pdt526zaSYEijlWOWrxhnGXBrMXxpoCUZAmxjOevJMibB1SeQ3nbj+1hEnt/9 m91n5DyVdEK2RV7alnI/OGt606/sngS4ynIMNTpK9oKFyYKh1+nJOyS8ABtFm0ydGTi1 09OLmtOP2MSu08CIVdKbFEWSqxN69KGCeIbQbEPRloTu9Q13+/O49SCQheLaE1FJ4F+8 ocvYmwqBMXU9JTOpocQ0f5FzDbmtzDkRBSSDtCEuH/vKKstPG7q0QFbj2FinQVm1JZro 0iNAHobHXmvbMmE5FQ/xi3WFRInXY86EhdnFFJFrZn4E7SSZUp7jf7/LFRl0XC8YReex wqdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si16824549pgo.325.2018.09.03.10.14.49; Mon, 03 Sep 2018 10:15:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729287AbeICVev (ORCPT + 99 others); Mon, 3 Sep 2018 17:34:51 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:44411 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728009AbeICVeG (ORCPT ); Mon, 3 Sep 2018 17:34:06 -0400 Received: from localhost.localdomain ([37.4.249.97]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MANKs-1g3yt827o2-00BbCa; Mon, 03 Sep 2018 19:12:56 +0200 From: Stefan Wahren To: Woojung Huh Cc: Microchip Linux Driver Support , "David S. Miller" , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH 1/4 next] net: lan78xx: Bail out if lan78xx_get_endpoints fails Date: Mon, 3 Sep 2018 19:12:36 +0200 Message-Id: <1535994759-8938-2-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535994759-8938-1-git-send-email-stefan.wahren@i2se.com> References: <1535994759-8938-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:BL4mbsVup+oTe9EvMq/D8jhxS4LWLU2qYp6W7/Kk2gLsufXX9j4 Q6qdE30ETptW/wy5dSsnze3bMzJYP1nF9tAHGT0gvdY5LonBjdWxh1zPC9PL/eALqJhyzwA STmZ4FAsNhuPVmGm9eB/YdEmVzbUn1OA6Azlgo8u85QysZzT0xJYPiYavNkvWp+HUjjVzOH ewxbuZdsuP5KFiUK0hg5A== X-UI-Out-Filterresults: notjunk:1;V01:K0:Te/p+sDip7Q=:CgIwKBBM/7R2VYUQOO9r5B /WuyyL7n3/u0388erubDhCY4vtwQJlckHHGvHjRQZVKVj2SY7HQk64G/eZQx3dP2C267IVeIO EySWq67M1wDidfteA2e66ZfUmAiB3Kp3lbdydILELdyKc/dHzy7vJT/m9x6LtVUILH4o9tGsb P59ddnPkMacM5RtLvwE7ikcTOrO64QhPwAwnj0p4eZuDsbDaxphuDuqEE/RuLCFj1QAy1LJYv WhbjYAiJyJXh0tt14pCZRwA7UvMTZKgpZUqAuVguBsmTjPERfFtg17J7k07jOr0Xz4e1Uss90 KKIWpObPtSFNJSEsS4cWINUGD39mN9dEGh5gOeycU1EitYbULeHblEuidH6kznrtO/g99jMID gYRtzzeuxt5DsrGrINKU7y5ULenSKiBn53mSPsFSWfHBm5yphufvqAYzwu0P42PxiCJHw0V+N ofASIb82LV7Ul5dm51xRLjAgmPM69ALPlUdlmwSiC4+oPXIliHVxdB4HfOb3Q9XuQguTMQiRd dLfvs+vp6+xPMBe0R6c5atzllW5KL7rydyRJ+mhX+VE+1gCmw+YlF+F5jGxFgSD+9N5DINdPC u9M06oZQp/8p3Cp4qgLflJ3rUhqAGTtc3TOo04VRFqLW8xE1D8NwuZSHP+t68oYKBqf63kXpK sxb0kja5PMBVdDFpg88Ez/CCsjCQ/h1P1X0PX682i5D7ZMk3oPF0FI1kseO/I7f4KPhw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to bail out if lan78xx_get_endpoints() fails, otherwise the result is overwritten. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Signed-off-by: Stefan Wahren --- drivers/net/usb/lan78xx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index a9991c5..3f70b94 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -2952,6 +2952,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) int i; ret = lan78xx_get_endpoints(dev, intf); + if (ret) { + netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n", + ret); + return ret; + } dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL); -- 2.7.4