Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2673894ybl; Thu, 29 Aug 2019 11:17:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyP6DLD8jlcZmiyirhQ54EKWzoRwjphiQeadq3DkVkgLB5WFxxzGISXV+U72sjeuHp7bZJ3 X-Received: by 2002:a17:90a:e984:: with SMTP id v4mr11683091pjy.128.1567102650713; Thu, 29 Aug 2019 11:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567102650; cv=none; d=google.com; s=arc-20160816; b=rIAFs9T9vcrQlnaKv9yH4VoGmSTvXYr+xQm74JJW3VC1Wzk5xR+eprbnTWtOLCKQyU RPt/sD3qEdBe2u+6Ygz3tmR8ZbJxGCeSeR3vZlqMoc+hrrLuwJT1HuzP9a+aM/7wYdrd fvRY1Wu2IIzquLn+jgEJs+9KUWl/jkFyqtcHO5ALP1XdUx5pya06l6+6YTbH+yzoW0Ce 1QYefLl8fYOy1lRqmwaddsBALhtyPad8XIkOJiZ5UK1BIqQ22oLLQ2kj1X9/eP4SI/bV DpBxRSux+aFpuLVaXFd3p5+0BhtNNKcFvyzLTTaY5ct+sbqYeZH0ODjUn1dnxUHU/Ta4 6pSg== 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=MGZGzt0gqD0eAdCbcCr1bYaAwDVUvB8NoKsdrPwCmyA=; b=HRH5X42SQFXTKnFR2pCKRwPTH+cctne2eUFZF2wsL1Y1Ww13bnxp2slXNrL8SBZABm gqGR0pbbP94R5wAVgOfbj/YCJ7ydhd1D2mPwKv1ZUWACDoDzi/AbesmbUyd04zgQfgNS t2U90a6njcy3QjDbW2voGvgxgyPzOejCInv1nWcJS5lH/tael0MnbVHlRlf/orYf0GdE QZAf9Yq3ZItEx4PcbfoBI2BSidrDEOUGWpErhBxkSQChMPqiK0XKuZJIcHOkRC6yv3Qg 5r5FpCAWwrFR4297rCMRIgFsZlwxPaOh5tisLe4bnVlAcH58ol9HrSL3vzCwMlyt7DYg vitQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ztvsSULn; 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 m6si2685370pgb.367.2019.08.29.11.17.14; Thu, 29 Aug 2019 11:17:30 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ztvsSULn; 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 S1728859AbfH2SOc (ORCPT + 99 others); Thu, 29 Aug 2019 14:14:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:56164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727867AbfH2SOb (ORCPT ); Thu, 29 Aug 2019 14:14:31 -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 7ADB8233FF; Thu, 29 Aug 2019 18:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102471; bh=ENnQuLStlcZZoMrEABGmkjS1ER3wIKINVJAynfvsm4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ztvsSULnZYLgFrxMGhcVPnS/zw2lbvc4AwFZ/okL18zHtgKerG7qLCynqt4LqzTkd MeWXj4uWFxsz9RWL8tOH+sLOgpdI50IcfwDCUNgCHW5EBdjuKilhxzTd3KLgCDuML5 ZCVda9+alnYoZeayljHC4pxkqqzHyVixLYKceRF4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wenwen Wang , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 35/76] liquidio: add cleanup in octeon_setup_iq() Date: Thu, 29 Aug 2019 14:12:30 -0400 Message-Id: <20190829181311.7562-35-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181311.7562-1-sashal@kernel.org> References: <20190829181311.7562-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: Wenwen Wang [ Upstream commit 6f967f8b1be7001b31c46429f2ee7d275af2190f ] If oct->fn_list.enable_io_queues() fails, no cleanup is executed, leading to memory/resource leaks. To fix this issue, invoke octeon_delete_instr_queue() before returning from the function. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cavium/liquidio/request_manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c index fcf20a8f92d94..6a823710987da 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c @@ -239,8 +239,10 @@ int octeon_setup_iq(struct octeon_device *oct, } oct->num_iqs++; - if (oct->fn_list.enable_io_queues(oct)) + if (oct->fn_list.enable_io_queues(oct)) { + octeon_delete_instr_queue(oct, iq_no); return 1; + } return 0; } -- 2.20.1