Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4426183ybe; Mon, 9 Sep 2019 09:06:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiouk/gnQzo7OIPxPMKaed1tmKquC5OuJB0D7g7mo6kwtb4YDwRGCxGkS7BuxYl4NvtUqw X-Received: by 2002:aa7:da59:: with SMTP id w25mr23700913eds.143.1568045210031; Mon, 09 Sep 2019 09:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568045210; cv=none; d=google.com; s=arc-20160816; b=iTCH6BNfBifvC4lnSvopZ1acYI3RmQRS6DZfXJdJZubpkhAuiJ2RrSHetUTN6wMGef iUf2chWeFdkd4bTsNc9GdC8tBi234e8YMVt7VRHek/Gn5caFUmJ0uSzwOpO8rzlC5C3i VcNIMdqW0esJ1ko8TibHMs0X1RId4xgIJV2PcSHT1KFysgBV5d9QqsgH2nZGcFoh2DvH NkfW9DLF6pb3qTe7T3gQYGBV5VqNujgew6PNb2171HiiwCcypbB27eOidJgncec10pwk dB48HbVmrZobLZAlATgfQSrYhJgnOUuU6qDPE9kS4EHDjwpzHVlc/FzaKReJH67ZRvZ0 prJQ== 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=umO/yLXOFIYCpgemQvs4y5/i9nY3lLFD77f/ietjMRk=; b=i31nQT2GvmrqO19ZSJPC7AnzwL3WXUtqZoOh7zNybdnw2khmwIub1YK3S5vpxW8QZS iEu2PqcWXf+1Vebm/MGoO/uysUN9YotGtrbjPfNzmqBUtks1uegqqPZ48/MK6LB21BHT dWbMzMSudhl+YJpSyF6muhgfPLOepPhDrbYSZ6PoH7xhAmh1EpTjHibGFuL45vmg8RMn BOFWRdBv6N+645OURJ16m2FuFZOm0NvLlHl0j864EZAmIKxGga1AwrBFYJfI8T+x6i1f Zpy8JmB57ZFqFPXZ9nzF6/1R1AsvVKf9Xv05JyRciidyBPN+vDsXi1EYA0s9SAkMFNb7 kECQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KhVci2Vk; 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 b58si8507704edc.97.2019.09.09.09.06.25; Mon, 09 Sep 2019 09:06:50 -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=KhVci2Vk; 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 S2387661AbfIHMxa (ORCPT + 99 others); Sun, 8 Sep 2019 08:53:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387617AbfIHMx0 (ORCPT ); Sun, 8 Sep 2019 08:53:26 -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 0BABB2190F; Sun, 8 Sep 2019 12:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947206; bh=2IMqh2I9r0/tQn3n3KrKnfXUTdJBdIYC20ZWkmNy9+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KhVci2Vk6j+R76eKhDgmT6QNwKcnLd76v8sbH06rlTxXsPP/hF8Its7+qfQ0D7EQP ZvEV8QfBX/z2rfGvdQAadjjp7gXcucQMAUPRA2UWxfTdAxXFwcjYj7hEJ22x8GSrwV vpvhkLu58ULOHp12MucdeFyiSn3hmUzFeUzbfpBg= 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 5.2 51/94] liquidio: add cleanup in octeon_setup_iq() Date: Sun, 8 Sep 2019 13:41:47 +0100 Message-Id: <20190908121151.899401924@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@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 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