Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1638956pxy; Mon, 2 Aug 2021 06:51:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7moGTSpemnatLavjD/FcG8cosg3KqQR7zlCe5cB31TjWi43Lr1NmN/i5T4vKDa3zKuyWQ X-Received: by 2002:a5e:dc48:: with SMTP id s8mr1642269iop.133.1627912260845; Mon, 02 Aug 2021 06:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912260; cv=none; d=google.com; s=arc-20160816; b=QGLvpEhpHJz6/Y9IK29+zd6IpEn0sh1f8wK/EUehVIwj8C1+2QddltRtystldsAZyu GtMalC1XyJarF47rhHxYrfssF+cxHnO9Zp0fh+mPJ3ngobl+FWuFJ38gjw70rRausb8U 0i56mfGLXJWyh+jnfpWMeQMjjFcsDVIUjbiIqFnHprvzdH1FcctUuVLVMIN+857SwkOs lgn9JA0eviU4K8eYjcfAaKV/+64mSQixzImxcvXyGU/cs0XQA5vGkrwOKRIQSKA3HgL+ IKdf3JLHifLVKcbjzqiPtuXUzyRSWcxWcgkis/qCGiwpjuQNQSsxD79Cj+GN9BlTzfu0 8FTw== 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=QugDfeJYERcr6kUhQbgsN6TVafIHBBsqYWNp9bKadeE=; b=wXC8dIYllwEXqc935UUbZfQJDbuFby9augjV3MAKQNLWfsfmKYo5FiVxwH2Nb5q/6/ o9PLD0fMfw+XqQBHlmf2x++FibO4TWaveiCQQS0JY8aNCXADSsfqeVDCyJAhIPpYMUXA QoR7yxfF/OvpHoTbKuEopi00IfpYRZFgoh4ODn3EGrAt7/WuZuCUt8vwWOiVsJW/tj79 rFYh8b/IQy3PBdUw+IITZFMNTVRXnakCsGpaBUXXTG5hZJpT/bu3hD1U6bNsquMXBT7d BLLb3elYFkqSNXK0caRly2rtIyu7+nyVrsTPLDFuP6y9C3GK79uBfOFuizw4qe/RZ2fc AtEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=slnjVH1A; 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 h21si11041092ila.73.2021.08.02.06.50.49; Mon, 02 Aug 2021 06:51:00 -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=slnjVH1A; 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 S234788AbhHBNuK (ORCPT + 99 others); Mon, 2 Aug 2021 09:50:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:57478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234375AbhHBNrf (ORCPT ); Mon, 2 Aug 2021 09:47:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B9EE061102; Mon, 2 Aug 2021 13:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912039; bh=3q494ZTRD0FYNLe8FGVRRXJETCXL4zPyz71GQjS4XJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slnjVH1AQ1dnnYfFb85Pw/qLORlV/3rIL0U3vahzdY3w2yb28vhCoxPXbt9e7qjk4 +6ma7dnbJASO/wQY+iPxFwXlkSAsfEpgtLtYt/7dIdb0IG/Egw/Q5KsfSAzMm/P65W Y3b5eCG74zdWkYaHl25ojTpkvZYhWVN4vfYASru4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kangjie Lu , Shannon Nelson , "David S. Miller" , Paul Jakma Subject: [PATCH 4.9 21/32] NIU: fix incorrect error return, missed in previous revert Date: Mon, 2 Aug 2021 15:44:41 +0200 Message-Id: <20210802134333.591427908@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134332.931915241@linuxfoundation.org> References: <20210802134332.931915241@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: Paul Jakma commit 15bbf8bb4d4ab87108ecf5f4155ec8ffa3c141d6 upstream. Commit 7930742d6, reverting 26fd962, missed out on reverting an incorrect change to a return value. The niu_pci_vpd_scan_props(..) == 1 case appears to be a normal path - treating it as an error and return -EINVAL was breaking VPD_SCAN and causing the driver to fail to load. Fix, so my Neptune card works again. Cc: Kangjie Lu Cc: Shannon Nelson Cc: David S. Miller Cc: Greg Kroah-Hartman Cc: stable Fixes: 7930742d ('Revert "niu: fix missing checks of niu_pci_eeprom_read"') Signed-off-by: Paul Jakma Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/sun/niu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -8213,8 +8213,9 @@ static int niu_pci_vpd_fetch(struct niu err = niu_pci_vpd_scan_props(np, here, end); if (err < 0) return err; + /* ret == 1 is not an error */ if (err == 1) - return -EINVAL; + return 0; } return 0; }