Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4344081rdh; Tue, 28 Nov 2023 20:48:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvYb+oaYpWQBJauJTrC/c+ZP3I1Oo6Ng4SnbhqGelNb4dzVNAxYMsAN5sYDo/FvPJx03SI X-Received: by 2002:a54:4482:0:b0:3a9:bb08:d468 with SMTP id v2-20020a544482000000b003a9bb08d468mr18769018oiv.55.1701233293393; Tue, 28 Nov 2023 20:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701233293; cv=none; d=google.com; s=arc-20160816; b=nsSpS/JSCNLh256BxO3eXfY/ZOMibbkJN5AwG52iSMnl4L0GJdNf43x4UXrkst+kd+ LucSnPKj3/zOr3QDv++PdCpL+p+SsyuLNtT+JV2bcCEhCHUYsAXxE36WJLWSJBmixDv5 0pqbRL1puiuOG3xe0hhoCArMbprt5tjVgDJ1IfXZvOjneR1veBcHnFSUe0AOy3DaxDve QKsnFuocbGrM1gJQ5Bexr9BtCWBvjZtcBs2riy8RqpQr/n8tWpJReVwvC53+b6PzuD3f su1DGRzVgjmkhTQwfVjKahQmHG1OYXMZxmGUmoHpT2wM8+uQreurP2I8/ruT9E09eyEh Aetg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=dyJ7m+51y4ahmti9gk/zls44GZcR4LkgJWV6Mhc9cho=; fh=1lqMcGafbuQbEth15ub6L1KQ35lecAFMbgAw78LZHCY=; b=JRGfCjginrliuZDa9b7r7SqVyPy0jJ4H/8GGMkr/YAJW50acf+tohe+BahEnQUUR9d eWHlsA/0heyz+8TvEKqYuiLdbrix/qi22IgnSdyVwSD/jPHY2gsHJVAMY8jIAii/pCpG mtxHFyeiLrNRAE1rETwV7FRgQrUmhyKpKYVa0TW6dfx38/A6AwrGxmwOvfb2QXhsSmkU 1bV94mXnl6Q2mQE5vosCoRy1H9wETO6YVBxnwmo5Kkojn/BmmT95LmLhdFEe9ylaX1ov cRXZXyYTVX1O++KEqUGTk4tjm7NurAASYPHhLEzHyJ96jlpzbrvCmPa9oiczHQZMSHw+ 9BbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X5O51FlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p12-20020a056a000a0c00b006933caa6f03si13830225pfh.165.2023.11.28.20.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 20:48:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X5O51FlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1AF9880ADED3; Tue, 28 Nov 2023 20:48:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376904AbjK2Erv (ORCPT + 99 others); Tue, 28 Nov 2023 23:47:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230176AbjK2Ert (ORCPT ); Tue, 28 Nov 2023 23:47:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25820DA for ; Tue, 28 Nov 2023 20:47:56 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB815C433C7; Wed, 29 Nov 2023 04:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701233275; bh=YI4fuxLiITTplMPMdCUaoMC9gkukDp8WeBYUthwy3Es=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=X5O51FlSMIA8mrnaokXk/71U+U4uj+W37AvfVjLvchhEkGGtPbGDchtTkq+qZ+bXF U+Z9cVy6RpYC/Op3qo4bYnucpy31LKh50Nj1jqYoSOEz6+FNAYHtanysrqBaaXQ1Qz v3XFfvpTvZwkC50YY9o+KzzuyAFgfEkX9N3wPvuCap7O+VTnhChN02dbCkh+Omwa9s gTvjDdASLkinOJUqYc4D9vIg7afjn+uN9skV4nIBAyBiSrkm8KCDN7xHkmg2gTwer9 Z40vnH6f+my/jAzqlV0lPYpGEOgtpV+JP1ASWi0amJTKwxKFMLNdeamq73DgKSONIM IxYPH7MjhhzLA== Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-58d521f12ebso2458906eaf.2; Tue, 28 Nov 2023 20:47:55 -0800 (PST) X-Gm-Message-State: AOJu0Yzep1ftciDa8dDGQTuG6d8b1HYF2QuXXgrBWqaH+2cK0aBTj8nN evqhAJfpNDe/VMg5VnbNjh4uqYoAWty6uxQPYU4= X-Received: by 2002:a05:6820:228c:b0:581:e303:807c with SMTP id ck12-20020a056820228c00b00581e303807cmr20742246oob.5.1701233275064; Tue, 28 Nov 2023 20:47:55 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac9:5bce:0:b0:507:5de0:116e with HTTP; Tue, 28 Nov 2023 20:47:53 -0800 (PST) In-Reply-To: <328ad7a1-7c54-4028-ae79-eb25c8c7399b@kylinos.cn> References: <20231120023950.667246-1-zhouzongmin@kylinos.cn> <328ad7a1-7c54-4028-ae79-eb25c8c7399b@kylinos.cn> From: Namjae Jeon Date: Wed, 29 Nov 2023 13:47:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ksmbd: initialize ar to NULL To: Zongmin Zhou Cc: sfrench@samba.org, senozhatsky@chromium.org, tom@talpey.com, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 20:48:11 -0800 (PST) 2023-11-29 12:31 GMT+09:00, Zongmin Zhou : > Friendly ping. I think this patch was forgotten. Sorry for not sharing it, I have merged it into another patch from you("ksmbd: prevent memory leak on error return"). Thanks. > > Best regards! > > On 2023/11/20 10:39, Zongmin Zhou wrote: >> Initialize ar to NULL to avoid the case of aux_size will be false, >> and kfree(ar) without ar been initialized will be unsafe. >> But kfree(NULL) is safe. >> >> Signed-off-by: Zongmin Zhou >> Acked-by: Namjae Jeon >> --- >> fs/smb/server/ksmbd_work.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/smb/server/ksmbd_work.c b/fs/smb/server/ksmbd_work.c >> index 44bce4c56daf..2510b9f3c8c1 100644 >> --- a/fs/smb/server/ksmbd_work.c >> +++ b/fs/smb/server/ksmbd_work.c >> @@ -106,7 +106,7 @@ static inline void __ksmbd_iov_pin(struct ksmbd_work >> *work, void *ib, >> static int __ksmbd_iov_pin_rsp(struct ksmbd_work *work, void *ib, int >> len, >> void *aux_buf, unsigned int aux_size) >> { >> - struct aux_read *ar; >> + struct aux_read *ar = NULL; >> int need_iov_cnt = 1; >> >> if (aux_size) { > >