Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4362046rdh; Tue, 28 Nov 2023 21:47:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJ8xFMCOrW14M6uV9ewckyTygPyVf2Ci+T0oYTnKeAn+zZ6iKLk8NMlus27QO/xiYwjO6y X-Received: by 2002:a05:6a00:a87:b0:6c3:402a:d54d with SMTP id b7-20020a056a000a8700b006c3402ad54dmr16638969pfl.11.1701236824673; Tue, 28 Nov 2023 21:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701236824; cv=none; d=google.com; s=arc-20160816; b=bRht5dtH6iccS3o13MSQZtXNPeLxehPOL4f79CyeVfqSEF6hklidUghZOKewZJskMK lJu8QCi0K2WXIMCBp/wWpLCKiFYnIa0gEQZ5p85oD9mcnjguaI28yETz9fYY/itYDtl7 /trRmEOcB9gw/7XobTtoxCFOtUeGHFhGcALIvXz2a6nk2hd6h+6xYoZt5819lA+eME5+ fqQqThLXUzVQGZV7pgEV+HrrITY2T6W7EngbmyudwGFsNq9ArhEX9G0KiqkVeY26sRqt OlwINSjTtsCClqSnPmZp+wpXT4QIUGQRB4yWW1oIqUmJpfPICbV5E0SGqwINe0AnF5Hn ARxg== 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; bh=M7cfKKN674JWykwiMELWYH1XBerAkxGwuoQwiFzwO/M=; fh=dLoJMRNZmsjxwfzSMXGtF38g6QXbTV7PhXex+L4nfzU=; b=MaeCyHLkRJ5vVJRCq62puYvSXdCO480dvWEPjHerQTpO99I2j36p3LZTO/ivqVfXIg BNi1askektvUc5lYqhTqMPvnvikg4vPqU5Q+mQOWxgwoSUrs9WjBcyHaH2ekz1qXhCA2 fXoP51ecNf5ivMaVvNA3zWFzIEPA7oDp/5Tr7REt0mtzgr+IsDbPOrnXC8Ww0uHpf9bo v2kOi0jJF+H7cMtCf4tq6mWD4795hhJIXl8y1QaoCZyuxpPGdF2+nelodiU2QNJN5Jk0 Mh4WY8EIsvc7P5SioupWpv9qghwEJPjeXhMG5530wHOieEDzXxtBU5hpZiqQHrIjT7tr sgMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z9-20020a056a001d8900b006cbf67abff9si11710651pfw.269.2023.11.28.21.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 21:47:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 306FC80613BE; Tue, 28 Nov 2023 21:47:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbjK2Fqr (ORCPT + 99 others); Wed, 29 Nov 2023 00:46:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbjK2Fqq (ORCPT ); Wed, 29 Nov 2023 00:46:46 -0500 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 315B219BF; Tue, 28 Nov 2023 21:46:50 -0800 (PST) X-UUID: 7e2607461db54185a99458ffd65c0cda-20231129 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:96c9410c-7117-4f93-86ca-159676c708da,IP:20, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:5 X-CID-INFO: VERSION:1.1.33,REQID:96c9410c-7117-4f93-86ca-159676c708da,IP:20,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:5 X-CID-META: VersionHash:364b77b,CLOUDID:e3253273-1bd3-4f48-b671-ada88705968c,B ulkID:2311291131566H9M43EO,BulkQuantity:6,Recheck:0,SF:64|66|24|17|19|44|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:40,QS:nil,BEC:nil,COL :0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 7e2607461db54185a99458ffd65c0cda-20231129 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1982014254; Wed, 29 Nov 2023 13:46:36 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id BB3B5E0080FF; Wed, 29 Nov 2023 13:46:36 +0800 (CST) X-ns-mid: postfix-6566D03C-69019454 Received: from [172.20.12.156] (unknown [172.20.12.156]) by mail.kylinos.cn (NSMail) with ESMTPA id 85AABE0080FF; Wed, 29 Nov 2023 13:46:35 +0800 (CST) Message-ID: Date: Wed, 29 Nov 2023 13:46:35 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ksmbd: initialize ar to NULL To: Namjae Jeon Cc: sfrench@samba.org, senozhatsky@chromium.org, tom@talpey.com, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231120023950.667246-1-zhouzongmin@kylinos.cn> <328ad7a1-7c54-4028-ae79-eb25c8c7399b@kylinos.cn> Content-Language: en-US From: Zongmin Zhou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 21:47:02 -0800 (PST) Okay,got it. Thanks On 2023/11/29 12:47, Namjae Jeon wrote: > 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) { >>