Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp112228ybg; Mon, 8 Jun 2020 17:57:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXxa7XY7uw8VEzvPMSh8hjVcw6uEAm+m/f0jESJZB19kfMKWNbESr+P1Bg7qaH1TDXHs1A X-Received: by 2002:a50:f983:: with SMTP id q3mr25604978edn.259.1591664242659; Mon, 08 Jun 2020 17:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664242; cv=none; d=google.com; s=arc-20160816; b=lL53xMnSbIgFJi7/p/NMS7agA1RnWE++CSf7dUUt7zwInfBz6yqwTc3eEl2WfH+7WT U+v7AWXeyNJuOvzl9uKRrJsTFh4SgE+zhl0cN7uhQEDIzuffp2acc/qZ1wvXLhc5BHLI qHOJEEe+zEjt0FcmybCQkFGuTAT4kDfjEOnnHpH5bAMqppBV1s68nMBcoFeaMLKh9zUw TJ/LnYOhUDzDRRiJRGvFqg30Fn+lSGFVJ55oH/UpdHRPWjd3tAxiQUCSxOk7Dbfst0i7 c0fsczKCr1F/Y65IDDwBCeSvBwKbK9AaMJqnFZXxCsC1BAnFjP1jdupKLirTuS9YmENj Pu5g== 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=TEp03fIUoYJQtAWB4R79PrZ3nk0z0kOJ3zTifXNjpT4=; b=CN3+jNosi2X/iC7/vk3MkvKYgSA9p0b6P/arZuapK9AyKAevPuid2zRZYWfqfaoGNw EGW5MWM8YBAde9dCR3V+Fpi+FcboVp9lnHkUxrS3yvcwYMRXxKbmqqA8qujgpxomULh7 +QLtMN04NjGhMe8Ka3ff9Ozz3aWOPpXTBurxjBGI5u/RIFdAK+azw+EiAtXpdK8R/00A bAHBNE9GYK4Ob2X7LWuas9XxFKo7D12INS134FwTzTrKijCahaVMdtFw71EsZshlVxJg iAIP5BG87Upaq5W3QDlEVOhkmXOSTtPjWnyqq7M7+uLKjLquleHvXCwq1apyJGksWVQz 2w2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SY3QElyJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp4si12074412ejc.258.2020.06.08.17.56.59; Mon, 08 Jun 2020 17:57:22 -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=@kernel.org header.s=default header.b=SY3QElyJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731723AbgFIAzD (ORCPT + 99 others); Mon, 8 Jun 2020 20:55:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:55152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728412AbgFHXJ0 (ORCPT ); Mon, 8 Jun 2020 19:09:26 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 3915B208C9; Mon, 8 Jun 2020 23:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657765; bh=hS28z6xSWw2sPqJgW7kXj7XRamTjmuW8YLgw81pClG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SY3QElyJXncNMHxNSHQWhxnXzkSdOjg9mWPVJzZUyVu1DdElHRwzNtSWZ32ejlS2p NM2285EHTgyTtqlaBbexvQo7DsCbWyoN7doKd+Iga6B5eEcRk/6mXJpa0x16sB5De4 ztx17+VbVPXm5hOme3hd0wCd/CxHp/tsiAlXFS5E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Yongjun , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 150/274] octeontx2-pf: Fix error return code in otx2_probe() Date: Mon, 8 Jun 2020 19:04:03 -0400 Message-Id: <20200608230607.3361041-150-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-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: Wei Yongjun [ Upstream commit 654cad8b6a17dcb00077070b27bc65873951a568 ] Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: 5a6d7c9daef3 ("octeontx2-pf: Mailbox communication with AF") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 411e5ea1031e..64786568af0d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1856,13 +1856,17 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id) num_vec = pci_msix_vec_count(pdev); hw->irq_name = devm_kmalloc_array(&hw->pdev->dev, num_vec, NAME_SIZE, GFP_KERNEL); - if (!hw->irq_name) + if (!hw->irq_name) { + err = -ENOMEM; goto err_free_netdev; + } hw->affinity_mask = devm_kcalloc(&hw->pdev->dev, num_vec, sizeof(cpumask_var_t), GFP_KERNEL); - if (!hw->affinity_mask) + if (!hw->affinity_mask) { + err = -ENOMEM; goto err_free_netdev; + } /* Map CSRs */ pf->reg_base = pcim_iomap(pdev, PCI_CFG_REG_BAR_NUM, 0); -- 2.25.1