Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2863136rwd; Fri, 26 May 2023 12:25:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74l1v1apn5ZSWIq5by2WBVHMbwsir4LxmppZnicLpX34y51H0TCXI9xc8ooPM2QN1zYb9s X-Received: by 2002:a05:6a00:1896:b0:643:59cd:6cad with SMTP id x22-20020a056a00189600b0064359cd6cadmr5363146pfh.24.1685129107727; Fri, 26 May 2023 12:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685129107; cv=none; d=google.com; s=arc-20160816; b=Kl4rRcFMcxHsX7k5OY9Z90YQ8Db9BP+/qaCKKgjgdR5gWY5sgK8xFwrvUkMccLIFy6 WIyCwKqB2irkoYmv80nuq+Ohjme3u7g47jQ2GeG8WVdSKYVMVSQ35X8GjMPh4CTnpc2y WjDpsn0q7KbQczLKHDzDRGOrhVlNuGW65K/uei3PcmwODyuuMvzFFW9GFkiCaH09U2lr mvSwrGJJOuhB3brq/FV1KT3iES+lqa1uPPSt7QZALGSHGwBQwBsxmPp6bYYWACS9/STE AlGo8UYp4pN7gvzd+r6iWSG/jIdrf1bLP9I/9v+gWHcDZkNwsdVRyVLi+AyS5TUbxw0e IHSA== 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=CFzKx6e3wRuT+ze6CzWDU0HQxnfTqSD+dRkau4tMnWk=; b=i73P39Ub94hT2VZ28GFZlL4SZJqtwxUTj6RLrKJFqE4dzFgQM91Umxn2Q/SdH2+59f +aMEHlu71DELvd5ZBuMW4xWCMVBcSx8JM6OG9WHLOGNYijqaiF2pHqoXNpW9zBLWVA2S eLzvPalUfFs7htilgCmQHMEp78I+fbwyOhGCNCKupH2oZDvpEPdMRu52x4l1kcbq8I1+ kmIRK+ILEof53ZQlE74W2p/7SoxjjW9ViOsn9TKSvjgWPKiCGg1RR1VXahSG8SQrZ4KN S4PFburUwvK8E+K5Vhzl6isGvSVNmy3PZ9P1Xbi1BloqnwzAWfrPG9GLRJs+oYf+t/HI h5dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b="IQ/qNCri"; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=W9FRbhl8; 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 c131-20020a624e89000000b0063d2b810fc6si4653215pfb.305.2023.05.26.12.24.49; Fri, 26 May 2023 12:25:07 -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="IQ/qNCri"; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=W9FRbhl8; 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 S230085AbjEZTVq (ORCPT + 99 others); Fri, 26 May 2023 15:21:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjEZTVo (ORCPT ); Fri, 26 May 2023 15:21:44 -0400 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A509E13A; Fri, 26 May 2023 12:21:42 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 6D0D860204; Fri, 26 May 2023 21:21:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1685128900; bh=gdnV35r+qZer6ioSJSPnjms1VtPejxd0IlIT7RFCCbg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IQ/qNCriuge2j3d/O+15dL1nZPwlXbH+pDg9rJjS16liWnpzqTXbR7RVINDaCWIjF jmqP1qNdOImAt6lNiPow4lUeUIP+IPnTsYv0OSUTObsWiXQBdf76Q1BPZKSmxi726f qmKBGTborb3ZPnQzRsDeX5ofYhGkevMRh7+UNE/HyMywPZI0xbNmdNA1I4HhlfwHF1 VB6nX75KaEXWShSXkIqZZIWkCVDlCXWBKVt92xyXFlq/GeFzcJ1Ajw1XJTl5tNEEd7 0dkZw8XQvEeNbzBC33JLKVPyXoLj4/abakkFtIoX9FwI+qGofhSI6uXOhvKg4ljcPn G8BaBKky+fevw== 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 EjSdx_xuliag; Fri, 26 May 2023 21:21:38 +0200 (CEST) Received: from [192.168.1.6] (unknown [77.237.113.62]) by domac.alu.hr (Postfix) with ESMTPSA id EE76A60203; Fri, 26 May 2023 21:21:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1685128898; bh=gdnV35r+qZer6ioSJSPnjms1VtPejxd0IlIT7RFCCbg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=W9FRbhl898RDurbIWAG9elsTFrdcuRfZcsxKAIHKgpgJqhBCwFuf1NlyfZnpB6ojj PY0aBzU9IVi0yfT2ZO78/7KNaqzOvmsTuzoI4SgEDU2ZZQvxsxpFEoi882VNIG6GuP Jc+D6Tv4ca2y0hwq7l/HMaoIATrcAswvWxt0yGSlK6NSw1EF4szHWzZjwVo927hBJi 2zSiAxrDTqvNYIOYnx1jVHgr9+gXrLxbqMnLq4efex86sixX8cTZdXX8D1iP04BkZV MKjNbKNyGn/hDL+WgFF9J5KoH9i5G649CVKQ5ru7rlX2JHY6ow/PkacpRId2n/esWO p/wjtDeu1AIOA== Message-ID: <8412fb0f-4b7c-b305-0947-ae68701bad20@alu.unizg.hr> Date: Fri, 26 May 2023 21:21:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RESEND PATCH v5 2/3] test_firmware: fix a memory leak with reqs buffer To: Luis Chamberlain , Dan Carpenter , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, 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> <72257758-a0e6-1118-f397-431ac9ec3059@alu.unizg.hr> <828b1d4c-dac8-4a64-9f1d-452762dc07bd@kili.mountain> 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=-2.1 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 5/24/23 07:34, Luis Chamberlain wrote: > On Thu, May 18, 2023 at 06:20:37PM +0300, Dan Carpenter wrote: >> On Fri, May 12, 2023 at 08:58:58PM +0200, Mirsad Goran Todorovac wrote: >>> 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: >>> >> >> Wow. Sorry for all the delay on this. >> >> Reviewed-by: Dan Carpenter >> > > Thanks for doing this work! It looks much better now split up! No problem. It's a great exercise for the little grey cells :-) > For all 3 patches: > > Acked-by: Luis Chamberlain Thanks, Mirsad > Greg, can you pick these up? > > Luis