Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1956839rdb; Sun, 19 Nov 2023 18:40:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwcU5HGFIAywKHgAtlmeqPeXH3K4EkzMeJCLyUH9ZWkOwuM82tncp9u6DKRQyqqiSgVAMp X-Received: by 2002:a05:6a21:340a:b0:186:1663:53f3 with SMTP id yn10-20020a056a21340a00b00186166353f3mr4780632pzb.33.1700448019082; Sun, 19 Nov 2023 18:40:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700448019; cv=none; d=google.com; s=arc-20160816; b=qoDi+gu2rd/OHL15QQ7okomI8ZdwMsWB0xog46f9eIzf/oFFvD5V5QrUUYmMt9m0Ud 4/1K2tLxHBeafKvLmBREHjvJ2o3rdYyM4MBk/lh+XsPa8yZDoxM3TCrPDSlq1mR/XgCB Y47HX24hLT2LLSqHiZixNzU9N8ZN4qbwGQimPBnWjIfXNw1JdUf4DUO2Q6GS1xbuLPDR mqgUQt4VigKLJKi/6hDvo58noSJCBuw+NKpk/j/JjdYCR63GhBd+L+Y2blHiD0me9B6+ esJ210lq98cVgQJTiCPXXHQDPjooSnmXQv/gV8IB+eY1aqJH3+x2Py9Se9yj1pnZuw6S c72g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AwBrPozcnvfpgnS4XooJalGhZSWOg5dnr5Mu4PxqkF8=; fh=UQgoAjxh4qw81ACNWTN5z3Pzia+2NWsyobbXb21QfrI=; b=zM7O8HwC9y+sxEFtXrUYYqI4LxMVpkSzJuN9ccOuwRC5uJN59I7UyKhxAH9Hn6tZLX YB7g+O4DG5KLGwj/1bH75fA6G4ntMk6nbr4lzUrJe2F03zpE6FPbjvRSu+BNC79Tkiuu nIxZ3iVSBEV/Tp3OIVtpGc9T52hSr/7TvjyvU3N6S635ryNZ0iDIElUWM35TfNEKx6gU ViiLn4UwBvbiX/XC4GZtRDftwVG9I8E179vmdYe/DhphTyAH3n+ZwauJxJx7NsLY+yXN ZGNDvJE0HYEHZJH+hPaKIpTwtujrNr8ez3BERQs2NgVAb+SI5DsSzdf6ruV5ggscID7C qFsA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y14-20020a1709027c8e00b001befd0512ecsi6884728pll.314.2023.11.19.18.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 18:40:19 -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; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7592580560E8; Sun, 19 Nov 2023 18:40:16 -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 S231755AbjKTCkJ (ORCPT + 99 others); Sun, 19 Nov 2023 21:40:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbjKTCkJ (ORCPT ); Sun, 19 Nov 2023 21:40:09 -0500 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48204115; Sun, 19 Nov 2023 18:40:04 -0800 (PST) X-UUID: 39d7d5fb5edc46168faf7ff080bd8aac-20231120 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:8135b8e8-d3b6-4fe3-9943-462edf7b4002,IP:5,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-15 X-CID-INFO: VERSION:1.1.32,REQID:8135b8e8-d3b6-4fe3-9943-462edf7b4002,IP:5,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-15 X-CID-META: VersionHash:5f78ec9,CLOUDID:9ccfd572-1bd3-4f48-b671-ada88705968c,B ulkID:231120103957OR2B7NMK,BulkQuantity:0,Recheck:0,SF:38|24|17|19|44|66|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L: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_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR X-UUID: 39d7d5fb5edc46168faf7ff080bd8aac-20231120 X-User: zhouzongmin@kylinos.cn Received: from thinkpadx13gen2i.. [(116.128.244.169)] by mailgw (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1341798825; Mon, 20 Nov 2023 10:39:54 +0800 From: Zongmin Zhou To: linkinjeon@kernel.org, sfrench@samba.org Cc: senozhatsky@chromium.org, tom@talpey.com, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Zongmin Zhou Subject: [PATCH] ksmbd: initialize ar to NULL Date: Mon, 20 Nov 2023 10:39:50 +0800 Message-Id: <20231120023950.667246-1-zhouzongmin@kylinos.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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]); Sun, 19 Nov 2023 18:40:16 -0800 (PST) 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) { -- 2.34.1