Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp773815ybc; Sat, 16 Nov 2019 08:26:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxX6VDMiTmkCbNV9Ek+2AN57MdhOhe9FPyPhL3ItOCfY+NODCr664tOkxG27T8Uv46CIFhZ X-Received: by 2002:a17:906:1da1:: with SMTP id u1mr11168948ejh.275.1573921607972; Sat, 16 Nov 2019 08:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921607; cv=none; d=google.com; s=arc-20160816; b=f11Ne4osAR9hw9xWmOR4JVkL4ivwXXNFInfz69M1uR9lRo5ZTrd95dxop9edjP9WEA njXAq1DlKFXbkm+AWJutTCT0xP4QQsBaxOiICtqhvyIXsnlyI73xrS2JIYhuxxB3Ptom dAhaabrKadbBCsjwKxzhg6UxOiCWoVC/qoB3ejEqN3TRacfPgR+Vpy/kKMM3ao4BR7sF /MR8eoftiyHj6O5pLCz7YoJwQGPrQQRjd5vrEsA2QCPmwEQ0kjkzpeSVHiA2mbhSRSNV cDiDDUBNOk7TwCsFgyZosLbF3itbuElInOrwMkW/C8ZvotjgtNfoh+QPNfhfQi0y5lSI h1og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uqT+Z/yN2v47gJAPsKCFLbCHl+dOFHoKcwrPNCoSY+o=; b=C02T0roOCnRHwY5ugxG1rPw8TtCjnxfOQVUclfnEhvrkH9fqFdqzJJrYbMyRbj8K3N E21kTbTT7ytUF1U5Cwnk7C7DswhXO6WK5lg0mnxYKyfapksx98wFZsMVqU5XfOEsTSqd nqNiP7cjRrCCpTV6PoV/v5UvXUMDsRmqW5v1B7fKA5dpFbxkBDU8zBB/R4K/AcUYvlhH GYUdjqAXvzD9TbMmIQzegRHDcUGNf3hAe9k7qOw5MHR9J43TLs4c8EuschXKPTbu+uaY golGcxVut/RRXziQzxg2y6oYU5m8/v7X0wDESJfDPS5kXCO52o9mFkPyXPmL6Kq9IusB 5P2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZoCLRx8n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si8885889edq.173.2019.11.16.08.26.23; Sat, 16 Nov 2019 08:26:47 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=ZoCLRx8n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728721AbfKPPn0 (ORCPT + 99 others); Sat, 16 Nov 2019 10:43:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:47372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728702AbfKPPnX (ORCPT ); Sat, 16 Nov 2019 10:43:23 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 253FE20833; Sat, 16 Nov 2019 15:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919003; bh=QGsz8Ks1Tojt059lcycjgRGYNsiZ059yMmZcprWBtGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZoCLRx8n4/uUk8vPx22f7HT00O15SdXJ/xrAN+84EoiLUMY0x5ihjCjLUhSV+0QdS HBG+0gANwbdSMB5tZ4AUsQaptb+OW/de2wKNDElvbSTqsxN1KcsBKcgzWTt9/OOsiI sV4zmvZTHqoQKSPvwAClUTEfmZFfXajaQJBbZHNc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 107/237] qlcnic: fix a return in qlcnic_dcb_get_capability() Date: Sat, 16 Nov 2019 10:39:02 -0500 Message-Id: <20191116154113.7417-107-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit c94f026fb742b2d3199422751dbc4f6fc0e753d8 ] These functions are supposed to return one on failure and zero on success. Returning a zero here could cause uninitialized variable bugs in several of the callers. For example: drivers/scsi/cxgbi/cxgb4i/cxgb4i.c:1660 get_iscsi_dcb_priority() error: uninitialized symbol 'caps'. Fixes: 48365e485275 ("qlcnic: dcb: Add support for CEE Netlink interface.") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c index 4b76c69fe86d2..834208e55f7b8 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c @@ -883,7 +883,7 @@ static u8 qlcnic_dcb_get_capability(struct net_device *netdev, int capid, struct qlcnic_adapter *adapter = netdev_priv(netdev); if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state)) - return 0; + return 1; switch (capid) { case DCB_CAP_ATTR_PG: -- 2.20.1