Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4039707ybe; Mon, 9 Sep 2019 03:14:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRb7JjNvPEgvSpJhC2Nw83mDU0SW+31wBSo1u9DWYpJpeq3l5U1H2ruefTKxAvw6E+kyZs X-Received: by 2002:a50:a6c8:: with SMTP id f8mr23577770edc.60.1568024095250; Mon, 09 Sep 2019 03:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568024095; cv=none; d=google.com; s=arc-20160816; b=mBjncPfxh1Q+Sk2UvR5sRYDvPg52r/cUj51392FCi29Yv0Eo+IHNjLzLOqGKOMO2ge dnlnsSho2w2QOUTcx3B7//oGbhxgluowqrGpOrrq43dizsLGDGZ7CtVq71v5r76YMLm1 aUMjFZStLXqub9/WeX7aeswQkFZzysf/DO/I6CKxaiptlspAelRdCFc7eSoa23D12TlC Zg+gMLXknDR4GYJox+1U+zyBVyxLKMibIsm2dPmBVyZ5WnDP+TQUXtpe6s0tdNdHH2HL 2GpRH+bhPFbAtYrDxT9l44H+bFAWa1G79TdFhE8D2MBjulOizp8Cv0eFxxYBqZlS6fDv wnQA== 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=b3g8DeHqPkBpDt+tY0f5kfQk8tWS5fooIidJ3I/K6Es=; b=cLBsg4T/wPdhSLk/ymXvNlTXRNF4EY5GGMhohtcDPpuZp9egQdvAO9Ca3GFfrKlOM9 gFR82bUPAT4V6JjqW9SnOQ/JBRXqMdOM75tWzwKwS0t8nW0wwwTw/41qaIoLeuVEoyUC bjPTJtXALH9fxxJnmSkr6ZpJ/nUBu5j83T/S39WkkS11QM/7c+57AvCJn0L+c1mn7V03 6Zw3Artzn15QLX4S6a59zYeaxfJBksEUSWxL9BWwOVoiDnAY9uEb7XD1XWHimgCQYmYV 8eY5WcPP4GISmibS3S1LGBvrff6AW6Vz+37M3lwmjrH3bWyqlMW/j64jYytxGfi+mgi5 38ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="E/waX/RK"; 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 x8si8571698edd.282.2019.09.09.03.14.31; Mon, 09 Sep 2019 03:14:55 -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="E/waX/RK"; 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 S1730489AbfIHMqt (ORCPT + 99 others); Sun, 8 Sep 2019 08:46:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:34628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730473AbfIHMqq (ORCPT ); Sun, 8 Sep 2019 08:46:46 -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 38AD220644; Sun, 8 Sep 2019 12:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946805; bh=/uiRU/bRlf4Gi2FYLXPOHSkfVnfBB7FegScuSc57xQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/waX/RK2C7qqiOnFQ9zdjztm/dlhqHRms4NENo1mWTT9PaLnE/Z2uqiQB+GU96vb h4JXdyJaCgg4qy0Gd6Q7DqodSNtyY8irl6bbQRoG8mYxu0GlFS3wroDS02cTOBHKXE d1cxAmFINhygxCdTgs8swGPh1i7ojpM14adpIZ/Y= 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.14 11/40] liquidio: add cleanup in octeon_setup_iq() Date: Sun, 8 Sep 2019 13:41:44 +0100 Message-Id: <20190908121119.994516726@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121114.260662089@linuxfoundation.org> References: <20190908121114.260662089@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 1e0fbce86d608..55e8731264634 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c @@ -232,8 +232,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