Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp480863rdh; Sat, 23 Sep 2023 21:12:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1Gz0Ft6b6hItf5Kp2aGI6bB4YuhBmVhspqyiRBa6gD7ZaREJ1Gd5GHPwiO4RitlYfWf2D X-Received: by 2002:a05:6a00:2d20:b0:68c:6a77:4845 with SMTP id fa32-20020a056a002d2000b0068c6a774845mr4630138pfb.12.1695528740521; Sat, 23 Sep 2023 21:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695528740; cv=none; d=google.com; s=arc-20160816; b=FM2cRjoWIPteHJ7G1oE6CifkRr88JAN+dvtzDKN0zRH5/WM/BzVqtl4m8cPDKKjyff 2YkxNr/RDvcJv7tVmKl3WQzxV3sBh9ugbOaFTywOSjrQqYa5q4L6DBa4bgmK0siHYvYr z9NUsk7QIMM4Pl5TP/XlZELntw6VMidZQgFFOHW7oymBTgxH7NAk57e5ZsNgGIToT+p+ PfZIpueZat/DKOxPpcDkAgA9OlNRcSlPbJ0UCPTNs6k4QS0O/iE+V+YQThqfziMy76Mn 1I+pFwjPIiKu8XmXR08DSx9+MuECrtGh3FzH/wDHys1PQYqUDVbUnVSYjp64arpg5CbU B1nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+9TCVMIeoaNa3tagXTB1Bv+zF/jer3qFzQvPabTohzU=; fh=H5339eDhp6Kt9KLh2Fs35d5Ov64DV3NEAbndEbjrLqc=; b=VTqaLBunBN0cEwYu7hO2Pe95pLu4NzAzw12vRyGUmbYQG6oxhtrajSOYTlNpWjymwj 2/kI6deaphyoFN+ojGQGmIgnPy6cnB78iP5wcv7h/uO1idPAL+Ey8TYb/JiV/JAHM9ZH 998fQrsHLdYrG6HwwnW0rSK2cU6l/poADHKKZRljwJtNT4JICJgNtGlf+h5GDG5KAiKc 3R3cNCimwoXcgdtBXx4e6XQC7diCvDjm2uZ8tEFOgz0efbb/hcFod2p9KztYBtOsEFru K0TXArGsF2Xi4Mv+OvhZI6/qn+0m1yYcqfGXmWwyffAuGj431Vo5y2m46c7QDdBhdnDp o1EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PwyrubLD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e4-20020a635444000000b005774a3b3efdsi7066018pgm.301.2023.09.23.21.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 21:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PwyrubLD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C464B80CFD02; Sat, 23 Sep 2023 18:19:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbjIXBT3 (ORCPT + 99 others); Sat, 23 Sep 2023 21:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjIXBT2 (ORCPT ); Sat, 23 Sep 2023 21:19:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D94310C for ; Sat, 23 Sep 2023 18:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695518361; x=1727054361; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=qwbdzZ9YZc4PEwm2scK07yVZxE/6WeEX40p1ME2mjec=; b=PwyrubLDEw5FdXXLqlKBQE+jPRGP8lksO4E4PoMxZyVmJh/X6TlSy0Q1 lqwT8VclPS2yem0s3GKSsfElSexkdE5Ry2ct3MieN0aoN+lFzdjUDZZFS rSA6uag2N7zgz5sCNC/ZPiP/jD5BzaBRrHM6dEnZPcSXfuw8AzAMB/dn3 Xz8NQz6C+g2++x2905Z2bUK9NmU+x0nnU3qgw0JqN8OGVuNiqZGR1EZOw ya7dMQim3tVN87onr0RdWELNIhXv0slutB3hxwaRK6BT6VwlPkAoASXug 1tBkJK7fOX7Hd8NIDS4s1vS5kkDBTMoZMIJeQHOugv10BB1D9AgOVMLgu w==; X-IronPort-AV: E=McAfee;i="6600,9927,10842"; a="361317420" X-IronPort-AV: E=Sophos;i="6.03,171,1694761200"; d="scan'208";a="361317420" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2023 18:19:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10842"; a="994958657" X-IronPort-AV: E=Sophos;i="6.03,171,1694761200"; d="scan'208";a="994958657" Received: from lkp-server02.sh.intel.com (HELO 493f6c7fed5d) ([10.239.97.151]) by fmsmga006.fm.intel.com with ESMTP; 23 Sep 2023 18:19:18 -0700 Received: from kbuild by 493f6c7fed5d with local (Exim 4.96) (envelope-from ) id 1qkDmG-00034f-09; Sun, 24 Sep 2023 01:19:16 +0000 Date: Sun, 24 Sep 2023 09:18:20 +0800 From: kernel test robot To: Yuanjun Gong , tyreld@linux.ibm.com Cc: oe-kbuild-all@lists.linux.dev, christophe.leroy@csgroup.eu, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, npiggin@gmail.com, Yuanjun Gong Subject: Re: [PATCH v2 1/1] powerpc: fix a memory leak Message-ID: <202309240954.1H3G2rpy-lkp@intel.com> References: <20230915020559.3396566-1-ruc_gongyuanjun@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230915020559.3396566-1-ruc_gongyuanjun@163.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 23 Sep 2023 18:19:35 -0700 (PDT) Hi Yuanjun, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.6-rc2 next-20230921] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Yuanjun-Gong/powerpc-fix-a-memory-leak/20230915-100832 base: linus/master patch link: https://lore.kernel.org/r/20230915020559.3396566-1-ruc_gongyuanjun%40163.com patch subject: [PATCH v2 1/1] powerpc: fix a memory leak config: powerpc-powernv_defconfig (https://download.01.org/0day-ci/archive/20230924/202309240954.1H3G2rpy-lkp@intel.com/config) compiler: powerpc64le-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230924/202309240954.1H3G2rpy-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202309240954.1H3G2rpy-lkp@intel.com/ All errors (new ones prefixed by >>): arch/powerpc/platforms/powernv/vas.c: In function 'init_vas_instance': >> arch/powerpc/platforms/powernv/vas.c:106:17: error: expected ';' before 'goto' 106 | goto free_vinst; | ^~~~ vim +106 arch/powerpc/platforms/powernv/vas.c 0d17de03ce6a7a Haren Myneni 2020-04-15 49 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 50 static int init_vas_instance(struct platform_device *pdev) 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 51 { 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 52 struct device_node *dn = pdev->dev.of_node; c20e1e299d936c Haren Myneni 2020-04-15 53 struct vas_instance *vinst; c20e1e299d936c Haren Myneni 2020-04-15 54 struct xive_irq_data *xd; c20e1e299d936c Haren Myneni 2020-04-15 55 uint32_t chipid, hwirq; c20e1e299d936c Haren Myneni 2020-04-15 56 struct resource *res; c20e1e299d936c Haren Myneni 2020-04-15 57 int rc, cpu, vasid; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 58 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 59 rc = of_property_read_u32(dn, "ibm,vas-id", &vasid); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 60 if (rc) { 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 61 pr_err("No ibm,vas-id property for %s?\n", pdev->name); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 62 return -ENODEV; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 63 } 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 64 c20e1e299d936c Haren Myneni 2020-04-15 65 rc = of_property_read_u32(dn, "ibm,chip-id", &chipid); c20e1e299d936c Haren Myneni 2020-04-15 66 if (rc) { c20e1e299d936c Haren Myneni 2020-04-15 67 pr_err("No ibm,chip-id property for %s?\n", pdev->name); c20e1e299d936c Haren Myneni 2020-04-15 68 return -ENODEV; c20e1e299d936c Haren Myneni 2020-04-15 69 } c20e1e299d936c Haren Myneni 2020-04-15 70 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 71 if (pdev->num_resources != 4) { 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 72 pr_err("Unexpected DT configuration for [%s, %d]\n", 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 73 pdev->name, vasid); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 74 return -ENODEV; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 75 } 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 76 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 77 vinst = kzalloc(sizeof(*vinst), GFP_KERNEL); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 78 if (!vinst) 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 79 return -ENOMEM; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 80 9dd31b11370380 C?dric Le Goater 2020-12-12 81 vinst->name = kasprintf(GFP_KERNEL, "vas-%d", vasid); 9dd31b11370380 C?dric Le Goater 2020-12-12 82 if (!vinst->name) { 9dd31b11370380 C?dric Le Goater 2020-12-12 83 kfree(vinst); 9dd31b11370380 C?dric Le Goater 2020-12-12 84 return -ENOMEM; 9dd31b11370380 C?dric Le Goater 2020-12-12 85 } 9dd31b11370380 C?dric Le Goater 2020-12-12 86 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 87 INIT_LIST_HEAD(&vinst->node); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 88 ida_init(&vinst->ida); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 89 mutex_init(&vinst->mutex); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 90 vinst->vas_id = vasid; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 91 vinst->pdev = pdev; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 92 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 93 res = &pdev->resource[0]; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 94 vinst->hvwc_bar_start = res->start; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 95 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 96 res = &pdev->resource[1]; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 97 vinst->uwc_bar_start = res->start; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 98 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 99 res = &pdev->resource[2]; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 100 vinst->paste_base_addr = res->start; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 101 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 102 res = &pdev->resource[3]; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 103 if (res->end > 62) { 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 104 pr_err("Bad 'paste_win_id_shift' in DT, %llx\n", res->end); 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 105 rc = -ENODEV 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 @106 goto free_vinst; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 107 } 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 108 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 109 vinst->paste_win_id_shift = 63 - res->end; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 110 c20e1e299d936c Haren Myneni 2020-04-15 111 hwirq = xive_native_alloc_irq_on_chip(chipid); c20e1e299d936c Haren Myneni 2020-04-15 112 if (!hwirq) { c20e1e299d936c Haren Myneni 2020-04-15 113 pr_err("Inst%d: Unable to allocate global irq for chip %d\n", c20e1e299d936c Haren Myneni 2020-04-15 114 vinst->vas_id, chipid); 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 115 rc = -ENOENT; 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 116 goto free_vinst; c20e1e299d936c Haren Myneni 2020-04-15 117 } c20e1e299d936c Haren Myneni 2020-04-15 118 c20e1e299d936c Haren Myneni 2020-04-15 119 vinst->virq = irq_create_mapping(NULL, hwirq); c20e1e299d936c Haren Myneni 2020-04-15 120 if (!vinst->virq) { c20e1e299d936c Haren Myneni 2020-04-15 121 pr_err("Inst%d: Unable to map global irq %d\n", c20e1e299d936c Haren Myneni 2020-04-15 122 vinst->vas_id, hwirq); 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 123 rc = -EINVAL; 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 124 goto free_vinst; c20e1e299d936c Haren Myneni 2020-04-15 125 } c20e1e299d936c Haren Myneni 2020-04-15 126 c20e1e299d936c Haren Myneni 2020-04-15 127 xd = irq_get_handler_data(vinst->virq); c20e1e299d936c Haren Myneni 2020-04-15 128 if (!xd) { c20e1e299d936c Haren Myneni 2020-04-15 129 pr_err("Inst%d: Invalid virq %d\n", c20e1e299d936c Haren Myneni 2020-04-15 130 vinst->vas_id, vinst->virq); 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 131 rc = -EINVAL; 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 132 goto free_vinst; c20e1e299d936c Haren Myneni 2020-04-15 133 } c20e1e299d936c Haren Myneni 2020-04-15 134 c20e1e299d936c Haren Myneni 2020-04-15 135 vinst->irq_port = xd->trig_page; c20e1e299d936c Haren Myneni 2020-04-15 136 pr_devel("Initialized instance [%s, %d] paste_base 0x%llx paste_win_id_shift 0x%llx IRQ %d Port 0x%llx\n", c20e1e299d936c Haren Myneni 2020-04-15 137 pdev->name, vasid, vinst->paste_base_addr, c20e1e299d936c Haren Myneni 2020-04-15 138 vinst->paste_win_id_shift, vinst->virq, c20e1e299d936c Haren Myneni 2020-04-15 139 vinst->irq_port); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 140 ca03258b6b338b Sukadev Bhattiprolu 2017-11-07 141 for_each_possible_cpu(cpu) { ca03258b6b338b Sukadev Bhattiprolu 2017-11-07 142 if (cpu_to_chip_id(cpu) == of_get_ibm_chip_id(dn)) ca03258b6b338b Sukadev Bhattiprolu 2017-11-07 143 per_cpu(cpu_vas_id, cpu) = vasid; ca03258b6b338b Sukadev Bhattiprolu 2017-11-07 144 } ca03258b6b338b Sukadev Bhattiprolu 2017-11-07 145 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 146 mutex_lock(&vas_mutex); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 147 list_add(&vinst->node, &vas_instances); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 148 mutex_unlock(&vas_mutex); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 149 9774628acf8640 Haren Myneni 2020-04-15 150 spin_lock_init(&vinst->fault_lock); 0d17de03ce6a7a Haren Myneni 2020-04-15 151 /* 0d17de03ce6a7a Haren Myneni 2020-04-15 152 * IRQ and fault handling setup is needed only for user space 0d17de03ce6a7a Haren Myneni 2020-04-15 153 * send windows. 0d17de03ce6a7a Haren Myneni 2020-04-15 154 */ 0d17de03ce6a7a Haren Myneni 2020-04-15 155 if (vinst->virq) { 0d17de03ce6a7a Haren Myneni 2020-04-15 156 rc = vas_irq_fault_window_setup(vinst); 0d17de03ce6a7a Haren Myneni 2020-04-15 157 /* 0d17de03ce6a7a Haren Myneni 2020-04-15 158 * Fault window is used only for user space send windows. 0d17de03ce6a7a Haren Myneni 2020-04-15 159 * So if vinst->virq is NULL, tx_win_open returns -ENODEV 0d17de03ce6a7a Haren Myneni 2020-04-15 160 * for user space. 0d17de03ce6a7a Haren Myneni 2020-04-15 161 */ 0d17de03ce6a7a Haren Myneni 2020-04-15 162 if (rc) 0d17de03ce6a7a Haren Myneni 2020-04-15 163 vinst->virq = 0; 0d17de03ce6a7a Haren Myneni 2020-04-15 164 } 0d17de03ce6a7a Haren Myneni 2020-04-15 165 ece4e51291485b Sukadev Bhattiprolu 2017-11-07 166 vas_instance_init_dbgdir(vinst); ece4e51291485b Sukadev Bhattiprolu 2017-11-07 167 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 168 dev_set_drvdata(&pdev->dev, vinst); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 169 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 170 return 0; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 171 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 172 free_vinst: 9dd31b11370380 C?dric Le Goater 2020-12-12 173 kfree(vinst->name); 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 174 kfree(vinst); 1e5daa4a4c0658 Yuanjun Gong 2023-09-15 175 return rc; 4dea2d1a927c61 Sukadev Bhattiprolu 2017-08-28 176 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki