Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2821172imm; Tue, 4 Sep 2018 10:31:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZpQUCPoi4S+rFYTEK20+CD8gE16K/JySeOg/iGCrO+KypC1pLOmGrL9kANBis1kE4qb/xH X-Received: by 2002:a17:902:7587:: with SMTP id j7-v6mr35006395pll.256.1536082270370; Tue, 04 Sep 2018 10:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536082270; cv=none; d=google.com; s=arc-20160816; b=BLnQB85P4EgZMyqKncn4ha1ST/0amKxQOV3Sb92cI6ISDJqqU+qUqGvaKNLWaNrPX1 wtycbKgGx7WDCD+Agoa6nwiU3vUlr7/ssWztAZSH75N24aQhC0kHvGa9YJYBY649w3iS Y90MjM7MqN85U7QzLhGeT41HMbwyeCqyJ8ft3xUEv8he0OVjc4BkBTlTrd4Msr72+14j Vb4BNiQxlwlCwxRROJ3NjZhJ/Kogu+fLb8fSsvPgsau2D1EdBcG5Opw93ccWWGfQOYYQ kC8LcDfXg5/lcQ8TuJrbwskt5nAgiGfRwGwqFprxVUQIH+LsN7MLXL/YP579qLo6GPKf OMKQ== 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=eJqEYn3IXww/smZxZ0lBKPO96Pnjs/o4Xx7UdTBqOhs=; b=ptH20WcK3FvRmXc8DgOSP0p6DAChELf0c3Ab7nyb9XOguiNT8VKzKglPjVBL6HqruK ODOihCXlVorUtEl29xa5bj0MvXKTzUpm4y0Cpzyn96D1LyOb1IJPXJy5XFTn8if8GDDe 6nPRi/YvPiv3dXjHrxDfC5au2Xv362j6nZMppbqHqd4c69Lkm7TmKBLD4htSvTqur/24 DIufNx34zTVCZ6tPgH1dcPBrWb0Kd8dZyMTomIFtXu3ZCZ2fcWo0KEkiPsXQg8QBjGqK HxdgKQsPkqG50dM7Gz52hHupGTfN3ub7D/dxDe4AqgOUUrYkfsmFEyRvV3Sp1n/PAyEz KWlg== 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 s7-v6si20646027pgj.480.2018.09.04.10.30.55; Tue, 04 Sep 2018 10:31:10 -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 S1727872AbeIDVzv (ORCPT + 99 others); Tue, 4 Sep 2018 17:55:51 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:52579 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727272AbeIDVzu (ORCPT ); Tue, 4 Sep 2018 17:55:50 -0400 Received: from localhost.localdomain ([37.4.249.97]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0Lp7GG-1fREJi3M9c-00esIV; Tue, 04 Sep 2018 19:29:38 +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 V2 1/4 next] net: lan78xx: Bail out if lan78xx_get_endpoints fails Date: Tue, 4 Sep 2018 19:29:09 +0200 Message-Id: <1536082152-3669-2-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536082152-3669-1-git-send-email-stefan.wahren@i2se.com> References: <1536082152-3669-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:B/B9WzsyPV6JdCvAOS/Kzjn0ncEXoPUrMhptKGJjexecT1vqpOD eyu4RPmiCLJy63Uv9sCRjKqyAV7n+CafQ0+DCGZ/Wc9Jj2MByqinnxQRDe6fe48Qz3KIe9M +hyG8Fx8Zj3SOsxrCLo/TOwmjJnQHqt2NuXVMrzoxFOjP9FtgzF35lEip833g6HThWAaPgf On3HHCOaYF+UWPT7P2kmA== X-UI-Out-Filterresults: notjunk:1;V01:K0:LjWl2pm+5hk=:cbchJ6Zwyx6HaiJzUDXtO/ YIWPgF+pqkgCE5QD4LonANCoKQd5TzX3Aft3c+1FxWD3CqfkUHXX7XnjkGHX/CS3MNOp8+scD sFYEF7dut3niWECuuW1mQrWNEbmSRVgQgPhW1QF676WvAWfPpuDbnxwTmt8FT5Tusamcdexdo hIpEkvcKeBJLtW2PiVPBg90WDg/el197pZd7Zge5JmSrq7n5/A+w04bA5aaMU67o61JJUXxCI YHA/X/Hogqw9PLel/LIpu/Uobhe7g+7rIzFL840VnYAibpJSdw1kNFJfhBlm2E5f5cbcyFPtT QQcevy8t5pesSYUIcnFvxxtXO3hTrKuaro4UA4q0aSDQ4Io23f2CNR7jzycOl9aXY4FSi1ED8 96x4g4/sMhTzBd5TXyhq6hnpA4wExu/czpDu5fC4yeG9FSLWX2k26m7fcHjlr3O28KJ0kEdFc mOvK+DpzGzdOsD5JAJORoPy6B1zvIb15GEZP2WOudv+3jyLW3i0AdcJSiKMQa0iDdH/tIAs2H wPq7+KOhnGSeznVY0bppIeNxTOHHt76NWYvDrMo8RCUTfvjotHMlUGxSP90tO8A3MQV2ukmnx Q1hb3po9PS3UYm9p2FmHHxujpe8STz/8KVM/rM0bnARUwv975xhcTfXy7Hij+wkPhHV08zjvO 6Mc2VzhuaGbD6ZP4sYIbkv8Hk+CBCH4UanxrGxflNUv/+HMo99/qJ4wRXqJdIXXRZvOs= 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 Reviewed-by: Raghuram Chary Jallipalli --- 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