Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp347640ybl; Tue, 13 Aug 2019 22:18:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHErSMgLm1V5H0IJWc8qx56LJxgUMqbK7h9dsTPDTRGl9hMN7nvB0lYYXOgZuq3KeFhc90 X-Received: by 2002:a62:1b0c:: with SMTP id b12mr43864819pfb.17.1565759890090; Tue, 13 Aug 2019 22:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565759890; cv=none; d=google.com; s=arc-20160816; b=BFj9zwOC5ixdt56zNlzCWyudjslGsjuswOZ5d5k9d/sj/Gv28MkVQ/KI7nPcdycBzo n/LGao2+mMfpVKeBVp7YnK3Ubt10Sgs+5Jir2HRqzv+QbkzSTW50SPVfQvq+cLhoZFyQ d1LSCp3xcpiNyv7/d7SdntFGDYMOy39X/tQrDjXjCn6dv7GRpXfhLYbneu3D/pfCZa0y uqYv9AYQFdELZSDLXNdbo6g1Dm7CEhFitu3nPRgnEiTq1YdM+PopnKZpz7Xni1n+4ZrW Mkr47pgDT/zi6UsRUGmQwq4TduwUBDEUwsgW2H4X4vjtNeG2nGbc7PJ15BY6Je8ewx8E Fg7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=lD7K7srnZm3/fJdQ4MMUb4Yt0W08MUzcITPyxwLfAmA=; b=rqsW5JJXPnyRPqUySIgYvFaLkrrSfofL+3884poOEJdn6Fa8RAoPhehQqBP7dPfSdv xBL1Nwl5KzpqP/VX/QYVIJm203OZTuz6XrJbuweKglUgqIuQLlUdYFtL9HpSzW3olXet ekg/nja1N/v8nJJQsMjp0mkhyVAyIKHMBdA8fxEjziwVTisIoSI6fXU1CqqUTsoZ0spE vAdPLzOgiEPqy+BXHPwLmx/cny/K8+CX1g0QmxSzmBluJfUv8Hrn9sRC7i93rCsVlvJS KA0Wg2h2vo6hx1QPeNwdPUKXCFA8XFOO+lo34cQWL8XqTxY+b+BklhY8GozBVYi0Nd0r T7PQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h11si51308577pgr.555.2019.08.13.22.17.10; Tue, 13 Aug 2019 22:18:10 -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; 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 S1727296AbfHNFO4 (ORCPT + 99 others); Wed, 14 Aug 2019 01:14:56 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:37629 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726888AbfHNFO4 (ORCPT ); Wed, 14 Aug 2019 01:14:56 -0400 Received: by mail-yb1-f194.google.com with SMTP id t5so7330080ybt.4; Tue, 13 Aug 2019 22:14:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lD7K7srnZm3/fJdQ4MMUb4Yt0W08MUzcITPyxwLfAmA=; b=F/2y41XZ9wTXeFlGtw9NZKW9mcDwUSKNEY4So/EHnzZXTmpvq5UBcLxYXEooiufna+ VUUKZaqnbwCQ4HUsw+0ssTAAwiqVDL3XOizKNuW8RuqV95IrEqmLnyND1ClfhBP5ECC6 hqBMkW8ys7zXKeTCVXO/Zbt8FBgBa0mHztSQbEUz7q84EDUgvaH99ysA0fBgo1FLq4QU U3C93pogha4C78ySDpd7e4qOQeo+ATb/IM4jxdR6paFAkn2Y6Y+AyWTIdwSZbBa24lay LrnAFTTxMFTDcQzQ56myfZVsSXiev9FySbHDVytXzqJHREHP1zxW6dTdJ/q/7u7SrTxG dnIA== X-Gm-Message-State: APjAAAXcGCp9yUCtJcfU1cTcDYweyVO9BP7XHV1FhH1ygAt/BlemwPl+ uVHTdvqLRkBRtPvI4I6+MMB6eyZuKij8Tg== X-Received: by 2002:a25:9345:: with SMTP id g5mr1981247ybo.394.1565759695426; Tue, 13 Aug 2019 22:14:55 -0700 (PDT) Received: from localhost.localdomain (24-158-240-219.dhcp.smyr.ga.charter.com. [24.158.240.219]) by smtp.gmail.com with ESMTPSA id z6sm25581704ywg.40.2019.08.13.22.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Aug 2019 22:14:54 -0700 (PDT) From: Wenwen Wang To: Wenwen Wang Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , netdev@vger.kernel.org (open list:CAVIUM LIQUIDIO NETWORK DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] liquidio: add cleanup in octeon_setup_iq() Date: Wed, 14 Aug 2019 00:14:49 -0500 Message-Id: <1565759689-5941-1-git-send-email-wenwen@cs.uga.edu> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 0322241..6dd65f9 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c @@ -237,8 +237,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.7.4