Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2348199rwl; Sun, 26 Mar 2023 21:35:44 -0700 (PDT) X-Google-Smtp-Source: AKy350bZXNmDd91cFvdLElfXYTVPjrL1mpjeZC/GnaXnQvbiG+3NWBRs6VuyXrHTc0wgTlpwb7+t X-Received: by 2002:a17:902:dac1:b0:1a1:f95a:24f2 with SMTP id q1-20020a170902dac100b001a1f95a24f2mr12818340plx.19.1679891743723; Sun, 26 Mar 2023 21:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679891743; cv=none; d=google.com; s=arc-20160816; b=FaS10iwhSQKmZ8c5KruJjgyc6DT0+C3AFa/+gzvn1UoVOuPt1H1S8zLLHDNllCIgEF NsjWAJ/7iuqxO4gAO/QgEdbJ0PPXBmkEvvm6/EzctqzPIWQ+0xub4e1Y7T0255REDbIq sIiUDfG8DA5xdlGNU9LV8UbLWuo2szF0pdGVjiqZiHmvDtprPYr0nARK8CUix2NK2zLZ P39DfasFbN1XJ0MU1ZhMvjgmCBJ+Pox7aOdsf8BGwkwduK9N9TSf1gyWTvJ8cadBPLO8 hOcquqZO1sqabmzW2B0vCtNVrQ4on6TdxHsT9l10C4kxhqZsyG0sRCPKAvELdEwQUnef RM6A== 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-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=l7ijLTIesAOEpn36Fs42xeH/9XS1VZZGszE+oGRCXj0=; b=lw5BK+fyznIu6dBfvXSTccEdJYru+3/EP53DtX0C+dvP8b/7GRFvQ48eTTE8Q+b8+9 JuLQwAMJ4/pq0/InbnfoW/+9Euv0WqoN4cfSQdNDW15ptDr+pYb8hLn7gt3w78pEOFK5 7mJmKkVn+CcN/wTvTu8vw2jBOpnsHb2yw7DuvcvblRwRskqCEvVD/hZ+phgA9BHl8Ek2 v6gM9QVgxJwSDtMpcHeA5eTBGni7r2uivVXpTwXws/SL4+LPmTj4FqSyW9MTMxmrdqKn ntroM82Knu9PVLBN2jRg+3SpJExfrlfT1XrnSQSFrIMzmDtBMi6zaydSp03ewmDgHnkD XwnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nRFIUVWQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw20-20020a170903279400b0019c354055d0si25499023plb.304.2023.03.26.21.35.32; Sun, 26 Mar 2023 21:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nRFIUVWQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbjC0EJz (ORCPT + 99 others); Mon, 27 Mar 2023 00:09:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbjC0EJy (ORCPT ); Mon, 27 Mar 2023 00:09:54 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E6E949FA; Sun, 26 Mar 2023 21:09:51 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id l27so7220861wrb.2; Sun, 26 Mar 2023 21:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679890189; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=l7ijLTIesAOEpn36Fs42xeH/9XS1VZZGszE+oGRCXj0=; b=nRFIUVWQPecoMEHzKmyeLvjTcp/yjMztl4Pg0OOaG8c+ImjWC64i/lOL7hFiE1UqSX U4IGBSV4MEE8UmS8xQN+/sgPQ11QMkGhQhatGpXJHvAIhOxJoo8GFV+KXI6pFBeYFhTD D5J3r6GOqCIRV5KXr393hmZr/jh280QtfOE5I/RitL7occNpSq3UPSBipgTiOdj4ltxt 2H8v98bxRssnPxcUlpQhnHs0snHLhZ03REm/Vy7kVsOxbq5Hlbgwl93q0rB5MZZTqFn8 yhDWWFDeW1BCsZGPuUygdPsmdGQuT6rrkbzxnZnGjtKVuxCKHCZKuzXoLiGCRDXJhtW6 yJ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679890189; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l7ijLTIesAOEpn36Fs42xeH/9XS1VZZGszE+oGRCXj0=; b=nllaSjXukEVk+AXG34OkA40NwOsn9BqXi3RyMu1WwGF+w3ZeqTgN5ZvhdXftPlwFQ6 Kqs/hQFHiPRtnj6DIBn7/MLOLueym5MKuHz9uhsAbRo1LI/wKa50p/AmFoOC1ti8mwNb DViQczxlFOxVKNNJIhEn4qgqXhh8YkvZM9ioaT+gfbQW73AWNxqIuW487e9YwCm8Cii1 fOO2zC7By7A/7YUwbxLO0pQC1W9P+vU1i0ho1zkhwNbL6gI10PbmKM8+EDiJ/UwjXdxx O3825nfopzO6nC8B+KE0E/Lbnjh2S1ZUJRXQ4OChYGcuszIMWgOtavf6GNihfR1v1/+6 pLgA== X-Gm-Message-State: AAQBX9fiVV18gknGCSc8TOA6ih1xwhq5RfIYmfgbkMRsudsGy0vur3Y5 r+I2ArMvJl1SIo4qIeYTLpaVF+JiDas= X-Received: by 2002:adf:f2c6:0:b0:2d1:5b75:28f0 with SMTP id d6-20020adff2c6000000b002d15b7528f0mr8409709wrp.39.1679890189402; Sun, 26 Mar 2023 21:09:49 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id s2-20020a5d5102000000b002c71b4d476asm23832783wrt.106.2023.03.26.21.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 21:09:48 -0700 (PDT) Date: Mon, 27 Mar 2023 07:09:45 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Dylan Van Assche , Srinivas Kandagatla , Amol Maheshwari , Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, Konrad Dybcio , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Dylan Van Assche Subject: Re: [PATCH 2/2] misc: fastrpc: support complete DMA pool access to the DSP Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230325134410.21092-3-me@dylanvanassche.be> X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dylan, https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Dylan-Van-Assche/dt-bindings-misc-qcom-fastrpc-add-qcom-assign-all-memory-property/20230325-214518 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/20230325134410.21092-3-me%40dylanvanassche.be patch subject: [PATCH 2/2] misc: fastrpc: support complete DMA pool access to the DSP config: microblaze-randconfig-m041-20230326 (https://download.01.org/0day-ci/archive/20230327/202303270739.ODb2LA29-lkp@intel.com/config) compiler: microblaze-linux-gcc (GCC) 12.1.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Link: https://lore.kernel.org/r/202303270739.ODb2LA29-lkp@intel.com/ New smatch warnings: drivers/misc/fastrpc.c:2273 fastrpc_rpmsg_probe() warn: possible memory leak of 'data' vim +/data +2273 drivers/misc/fastrpc.c f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2227 static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2228 { f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2229 struct device *rdev = &rpdev->dev; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2230 struct fastrpc_channel_ctx *data; e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2231 int i, err, domain_id = -1, vmcount; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2232 const char *domain; 99edd50174e519 Dylan Van Assche 2023-03-25 2233 bool secure_dsp, assign_all_mem; 99edd50174e519 Dylan Van Assche 2023-03-25 2234 struct device_node *rmem_node; 99edd50174e519 Dylan Van Assche 2023-03-25 2235 struct reserved_mem *rmem; e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2236 unsigned int vmids[FASTRPC_MAX_VMIDS]; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2237 f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2238 err = of_property_read_string(rdev->of_node, "label", &domain); f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2239 if (err) { f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2240 dev_info(rdev, "FastRPC Domain not specified in DT\n"); f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2241 return err; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2242 } f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2243 f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2244 for (i = 0; i <= CDSP_DOMAIN_ID; i++) { f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2245 if (!strcmp(domains[i], domain)) { f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2246 domain_id = i; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2247 break; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2248 } f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2249 } f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2250 f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2251 if (domain_id < 0) { f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2252 dev_info(rdev, "FastRPC Invalid Domain ID %d\n", domain_id); f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2253 return -EINVAL; f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2254 } f6f9279f2bf0e3 Srinivas Kandagatla 2019-02-08 2255 1ce91d45ba77a4 Abel Vesa 2022-11-25 2256 if (of_reserved_mem_device_init_by_idx(rdev, rdev->of_node, 0)) 1ce91d45ba77a4 Abel Vesa 2022-11-25 2257 dev_info(rdev, "no reserved DMA memory for FASTRPC\n"); 1ce91d45ba77a4 Abel Vesa 2022-11-25 2258 e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2259 vmcount = of_property_read_variable_u32_array(rdev->of_node, e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2260 "qcom,vmids", &vmids[0], 0, FASTRPC_MAX_VMIDS); e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2261 if (vmcount < 0) e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2262 vmcount = 0; e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2263 else if (!qcom_scm_is_available()) e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2264 return -EPROBE_DEFER; e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2265 278d56f970ae6e Bjorn Andersson 2019-08-29 2266 data = kzalloc(sizeof(*data), GFP_KERNEL); 278d56f970ae6e Bjorn Andersson 2019-08-29 2267 if (!data) 278d56f970ae6e Bjorn Andersson 2019-08-29 2268 return -ENOMEM; 278d56f970ae6e Bjorn Andersson 2019-08-29 2269 99edd50174e519 Dylan Van Assche 2023-03-25 2270 assign_all_mem = of_property_read_bool(rdev->of_node, "qcom,assign-all-mem"); 99edd50174e519 Dylan Van Assche 2023-03-25 2271 99edd50174e519 Dylan Van Assche 2023-03-25 2272 if (assign_all_mem && !vmcount) 99edd50174e519 Dylan Van Assche 2023-03-25 @2273 return -EINVAL; Move this code before the data = kzalloc() allocation to avoid a memory leak. 99edd50174e519 Dylan Van Assche 2023-03-25 2274 e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2275 if (vmcount) { e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2276 data->vmcount = vmcount; e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2277 data->perms = BIT(QCOM_SCM_VMID_HLOS); e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2278 for (i = 0; i < data->vmcount; i++) { e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2279 data->vmperms[i].vmid = vmids[i]; e90d911906196b Vamsi Krishna Gattupalli 2022-02-14 2280 data->vmperms[i].perm = QCOM_SCM_PERM_RWX; -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests