Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10271757rwr; Fri, 12 May 2023 06:12:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vVZmMmtyvxGqipvexE8ZvYe73pygdXdm59phubIXxe2oRyiYV8CzewsMAOWmKW2XG8YFS X-Received: by 2002:a54:478e:0:b0:38e:56b9:aa69 with SMTP id o14-20020a54478e000000b0038e56b9aa69mr7306934oic.7.1683897163609; Fri, 12 May 2023 06:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683897163; cv=none; d=google.com; s=arc-20160816; b=ayZC87k8VEdsjv908g9RBlQF+WM/XoJp0jshgOUrVKHK+j7rtPR7CEUc1sy/InT9Vz 5ZOXrwyUKwSAXlE3eoQvtUCZ74lzRsycxNTIPCrpCPp0PG+1oY0Vn9yhx4ewbYcAG5Ax wk7icpYzb71WeMok9wrjAuZprt1LZLSY8nBlKj+3ko62bO9GOaiKkg+/nO9oKMNFwhcf AJ9QsOc9OaNELzqpC/OaMC7uYi+S8lU3/E7+y9MXJRM4GCCr8cFI4ehbT2GPedFS2RPc tvUuUdMVPHOPKjkCNP3QmEoQ2W8W+JYCd2MlMDHOJaXnyIRnWdnKvvU9v/AHu+/cgIDj cjpQ== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tMHC1baICqbV/7IIejzzefa+PcpliFHn4ViPUWBkzwk=; b=iaGfi6saF7SR+0S5az0NjH+Cz1+IyXNAL8JVcWx9HuS+tRkyf9mQxHZmDRwD13qA2J kvdFHaiwkUFasrUcJs/U2c5TK9bKd+uv2oibPBX5bbFNuEW1z7rXCLLr2ua6BgW3OS/v Z8Z8VgnnyWVqo49insRYi+M9woCSjfm9bVGxv7Y50q2h+vRInkKKVInXh5qgtvLtPOC2 GeaDqnQLwvnmKe2vNgrVLAspOFrCrFQssLPqq3BzNmabt1ViHBdPy/3fdhT7axZrR2/2 +NTKP2UGoaHbW8ukwJLT+19Rjp4YZcU1V6pBDSSUIjziE/dmFnwjVaTbNJsJtr1GZs/J zBmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nWdKOyt2; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a056830144e00b006ab0192f894si7775000otp.177.2023.05.12.06.12.30; Fri, 12 May 2023 06:12: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=@linaro.org header.s=google header.b=nWdKOyt2; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240471AbjELNJo (ORCPT + 99 others); Fri, 12 May 2023 09:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240586AbjELNJn (ORCPT ); Fri, 12 May 2023 09:09:43 -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 6F18FD07A for ; Fri, 12 May 2023 06:09:42 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-306f2b42a86so6585070f8f.3 for ; Fri, 12 May 2023 06:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683896981; x=1686488981; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tMHC1baICqbV/7IIejzzefa+PcpliFHn4ViPUWBkzwk=; b=nWdKOyt2/UbR8Uu1VEhhE0dtqojxGY5VLr2j4rxfWqEYlyoMQiirm9eeUQUileh9yP 0xe9zumAgOQSRTbDDV4nipBC7G9wiQkNrFwXSavhsfJjC37gfftYnUN6e0vOKa7KabnY PyXDE4TKxk5eVWjC8SOrRiCj6RN9wOluBZdhJxkHzDDssOMy3ZZrRaYmDHmDBGMGvnUn kxSDKf9u/omSXSkHcCvnq6pTQct7ws0uCsOBcZ6eB3Vxeim+9O5uFPl5yfMLsl8ZPSfE 0SGrN2xJMPi9LepKp+FRZmwiQ25F5BrWXuocFamnMgXEkpIHeR97ZrpTNt1FMTuP8RGG xa+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683896981; x=1686488981; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tMHC1baICqbV/7IIejzzefa+PcpliFHn4ViPUWBkzwk=; b=i3avmVKbwzH/OwPXpZybxOvitopXinNVSEo4hHwT1VMU6/egf1h/LmUx6r3/aOgl2L NO5/Ljyp0swC0wXJDva5AdGP2N/5i/Z0W1AD/mLbR2ioXFP+vyuVusacBxXnRqJwV1Cl b90XnpQqM/R2DiLiGHkyoQ0wBVgOwYW5t5b4hAYY9cOUghraO4nS5F3ZyA8M2ZO8bzAT DUdHQtKl5zZKYihS2IeizPzxqV5NCzD9y0n6ORFKU1FdtGRv8oBiQ0UtSOT+VSJqZ0ea owY5vSEQ4EgppEr2VajEbbHiKIQ3/gBTfEiKpRPiBi2k8Idihq/adm9ufT8TI+szPRFk N5qA== X-Gm-Message-State: AC+VfDwpBzTr3zxnOHUr2YvKCHsYNCoaK9KSwlo77UHgQLovGn9Ox952 RbsSk0lK2zCP/XcY09vY93B9u+R1Q6/P/Z76KI4= X-Received: by 2002:adf:e84e:0:b0:306:35fa:202b with SMTP id d14-20020adfe84e000000b0030635fa202bmr16017563wrn.6.1683896980871; Fri, 12 May 2023 06:09:40 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id o1-20020a5d58c1000000b00306c5900c10sm23226447wrf.9.2023.05.12.06.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 06:09:39 -0700 (PDT) Date: Fri, 12 May 2023 16:09:33 +0300 From: Dan Carpenter To: Mirsad Todorovac Cc: linux-kernel@vger.kernel.org, Luis Chamberlain , Greg Kroah-Hartman , Russ Weight , Tianfei Zhang , Shuah Khan , Colin Ian King , Randy Dunlap , linux-kselftest@vger.kernel.org, stable@vger.kernel.org, Dan Carpenter , Takashi Iwai Subject: Re: [RESEND PATCH v5 2/3] test_firmware: fix a memory leak with reqs buffer Message-ID: References: <20230509084746.48259-1-mirsad.todorovac@alu.unizg.hr> <20230509084746.48259-2-mirsad.todorovac@alu.unizg.hr> <256bc822-ba20-c41a-1f3b-5b6aacead32e@alu.unizg.hr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <256bc822-ba20-c41a-1f3b-5b6aacead32e@alu.unizg.hr> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, May 12, 2023 at 02:34:29PM +0200, Mirsad Todorovac wrote: > > @@ -1011,6 +1016,11 @@ ssize_t trigger_batched_requests_async_store(struct device *dev, > > mutex_lock(&test_fw_mutex); > > + if (test_fw_config->reqs) { > > + rc = -EBUSY; > > + goto out_bail; > > + } > > + > > test_fw_config->reqs = > > vzalloc(array3_size(sizeof(struct test_batched_req), > > test_fw_config->num_requests, 2)); > > I was just thinking, since returning -EBUSY for the case of already allocated > test_fw_config->reqs was your suggestion and your idea, maybe it would be OK > to properly reflect that in Co-developed-by: or Signed-off-by: , but if I > understood well, the CoC requires that I am explicitly approved of those? > If everyone else is okay, let's just apply this as-is. You did all the hard bits. regards, dan carpenter