Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4116665ybe; Mon, 9 Sep 2019 04:35:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAwHl5/BBXv18H86TSCghh7vzx+tBajAwVVC6EdtEszPni9QRcK7QxN+yjBfEMi4smMvqs X-Received: by 2002:a17:906:4e44:: with SMTP id g4mr18897052ejw.90.1568028959036; Mon, 09 Sep 2019 04:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568028959; cv=none; d=google.com; s=arc-20160816; b=L07dhFKTHTpkFeNsNdA9aHXTbc3Re2GgmQbM6ApuQOxTPD+B5d2F4BKglm5MOXsmnL 9DEJcXWKg2hU1kwzxExUeAwqvvpdA+OE+IgntYn1xgQdlSXcXdzwN06tPNoUevC7UN2w C3qAHjvFyCoVgbxE68I5JZkB5bhgtdL9e9u9gNlSK7ATMt2lPTyA3gqOD7y4uyLALDW9 13GercKZQQRGHWOcnRmZyRmE5UuBx6JSGDew/0o/r2TJKsDEtzHegNF1hsKUn4E1I6ms FQc0JiyV7+8FeMlH2XcHYsNCqCFaIFH9BaLREued/YzIyxJRRwktbIN/xMfXb6yIe9RR 6FxA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pYDptkwRA14w9HQrJTI2heoz2XG8UysJBpK4JEM+y+k=; b=ATu8oFFv0d0DpPLoCS8l1tWWEPqtaYlBEhSt4fL8lc/uvdjwJiDHkf0cNaEJys9CIF 3Olt4egbPJa2mrJ5HPIF1gExBvnVgsfpsTgaql5Y33hkS0x4lwHJXXdMEK1kaKKP9jVd IqqWC49cNrsDSTP5ktkfTgbOHUZDlfPcCa/jsRKBvom6Iu7hrAHy+AGmPbqq1tJqfENy UhJT8xhDDTt2+FgBywepRVc1dNkyPnK7BrtmPetCw4SJk5FZcphEBFDy+t3TUUol/wtf CqkSTnE6I5RoC8JXSfpxF/TwDElEwzGjsn3iMVJVt7tdOUbsndK5d5mI+GPcXcY8X1Yl 590Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c9W5U5vV; 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 q46si8341390eda.44.2019.09.09.04.35.35; Mon, 09 Sep 2019 04:35:59 -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=c9W5U5vV; 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 S1727351AbfIHMrw (ORCPT + 99 others); Sun, 8 Sep 2019 08:47:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:36302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728551AbfIHMrn (ORCPT ); Sun, 8 Sep 2019 08:47:43 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89BD52196F; Sun, 8 Sep 2019 12:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946863; bh=/Tc/KeZM2tcLgkwQkolR8y+hBSI4+tI3PX06LjjUKII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9W5U5vVY2FjEaww2KaAJqflhr1k9qs7w9j2svSf/mEBPO3drurKmJAweCPVJQGF7 +2mfGyyglpgUVSF2+f9slTrQXZGdm4tXHvm7pTthAc6QUC5MEpCLrJCGZCAspJCQEm PV0bSG+DSlPTjCXxSDHbGPa19eD2YaRij9l3ryU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenwen Wang , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 28/57] liquidio: add cleanup in octeon_setup_iq() Date: Sun, 8 Sep 2019 13:41:52 +0100 Message-Id: <20190908121136.504767578@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 8f746e1348d4c..3deb3c07681fd 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c @@ -238,8 +238,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