Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10775780rwr; Fri, 12 May 2023 12:50:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cRWd/D3Lz4lPQOm0WN6n5AeMwqQjoXifsbetHNmh5TWokezUpMWPI/dbab779sc0IJBwn X-Received: by 2002:a17:90b:97:b0:24d:fccf:7ba6 with SMTP id bb23-20020a17090b009700b0024dfccf7ba6mr25735524pjb.43.1683921038938; Fri, 12 May 2023 12:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683921038; cv=none; d=google.com; s=arc-20160816; b=m05XX+kg+dqfjMYPASQfN4pX8WcrH4wJdh9NJxcVHjYCByl3OCfxZ8/Pnk+NXVv1e8 nlEcnb7IyRgyo0P+sz+gAR+R11oGXqDZ1k5cYGBPFuDUX3mGY0rUN2+Kts9ThbHVRxB+ a+cOPeXgqJvAhIlcthM/nP2i8lL53lunUJd+JDJjg2cmxrgFUmPsNe4VZzUKXQzYxrBz jXib4Zciy5nC/piaRN/2hx6qWN/1vT1vJpIVfyUZ+YBmtgX2bv3TowKxu5IPmCQRFAbh gXh1ACQcIZuEojNjYpSfpkQ0mlOVPEEu9QSG8A6U39MXA6gDgNucnGN98gRc84YSSwE0 Q0fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=UkJcmmbsLu/yaX6I8DoUK9wHIfx5fmYhHmKMeCUoE8Q=; b=P3u6weMpC2cDn7ZfHM6ve5ew+r/OyoLXzKKD5P3BTeLbJ1xbSOC/C/vt5LzPlWZYqZ gtMi8Iz1wTUANjk0iPal9fnaDYbYa3CjNIREoBnKv4MWUbGNQDxzecUFE7bPprGGW2Mq O8QPnJIxdzqLva/oCBPi6USEXp0zj+QJAeI+6LbE6aJ2gBh1a5s3O1hMVjNpLi6dIYoT GMVroc9jJdbX1gkO4D5/sW2bEZ5nLLXyPY+rjGAdY78Wocs/cGyPPKiKxxEnJKQt/IDI 3goCeY54fmHfCClZhO//g7dTypgfZEURlJyQVNEXJyeKM4ez7hzGtjFGLueFX6DrHFe9 RFfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=pHa2nKCJ; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=PmGyGbpo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a17090a8b0200b0024496072b1csi34716256pjn.73.2023.05.12.12.50.24; Fri, 12 May 2023 12:50:38 -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=fail header.i=@alu.unizg.hr header.s=mail header.b=pHa2nKCJ; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=PmGyGbpo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238007AbjELS7c (ORCPT + 99 others); Fri, 12 May 2023 14:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237651AbjELS7b (ORCPT ); Fri, 12 May 2023 14:59:31 -0400 Received: from domac.alu.hr (domac.alu.unizg.hr [IPv6:2001:b68:2:2800::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BBD910F1; Fri, 12 May 2023 11:59:29 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 2B3976016E; Fri, 12 May 2023 20:59:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1683917966; bh=hCGxLmUFNgBLRFy5cKEjS0qJFgAEMpLY3ZFobzHgQzk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pHa2nKCJXE8rKIRkLbbUPjaMMGMp7nFmYiHF8Ea4FuaXAEsA7xvcCFENNf/k7frQY 2HHEiRnDRpaxKFQtlhQexKjczH0ZQYPMsEdwyT3XUroZGUnBJZ07Yg+IpKAgr5qh82 jzuDELzGnAgUSjmHaE97uiPmOumfecOYHy4yd4dFTa9KbMLc3zQMDPJmHlYmVPM67D r2jTCZybVlWZhBSFd2MZNajUsH3TjrE9aynCME2cQRi3uX5wMDEi53kSz/UbQUUwxI Iu48sDg3L0USN/VGvLqTuINvu9+55dX4CS7p9zNi+x4Y5KbC+gqRzyVaYnZZZW25/C CZW7IF+s/BNow== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SlCievW2rv7D; Fri, 12 May 2023 20:59:23 +0200 (CEST) Received: from [192.168.1.6] (unknown [77.237.113.62]) by domac.alu.hr (Postfix) with ESMTPSA id 02A906015F; Fri, 12 May 2023 20:59:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1683917963; bh=hCGxLmUFNgBLRFy5cKEjS0qJFgAEMpLY3ZFobzHgQzk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PmGyGbpovByG81R4WyAQ+UdFoqhvJywvMH3h/5iNm3J1k7UkB4Zu9K8ARFj5XjtzW xh5WJd+RPMw7Yz+5v97akb9ywS/2OSFbz1JyGdFArYzRtKbfNjSizDpUiC+5E1X33u 5pDJoEIm2WQ8Sv3vwBWxlpNtjMoywMH1+hB6xz6uPLUzSRiVfoUZkD92W/Mw2zwUMs 17T/jfjlsw64ME82Wo0Op8fTrCfTkAoilXjMCUimUL8hX4vc7cXlYtNKWhUOFHgc++ I77VTa21FQ5U8wUaSjN7AW0boe6e66BVxG38fDBJfc6O6tZuIZ4ysHS+1eB2AwMHXx CFghmz4SRmIjw== Message-ID: <72257758-a0e6-1118-f397-431ac9ec3059@alu.unizg.hr> Date: Fri, 12 May 2023 20:58:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [RESEND PATCH v5 2/3] test_firmware: fix a memory leak with reqs buffer To: Dan Carpenter 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 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> Content-Language: en-US From: Mirsad Goran Todorovac In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 12. 05. 2023. 15:09, Dan Carpenter wrote: > 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 If it is OK with you, then I hope I have your Reviewed-by: I'm kinda still uncertain about the proper procedure. This certainly isn't "the perfect patch" :-) Best regards, Mirsad