From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A86EB64DB for ; Thu, 15 Jun 2023 11:38:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343973AbjFOLiu (ORCPT ); Thu, 15 Jun 2023 07:38:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343968AbjFOLiD (ORCPT ); Thu, 15 Jun 2023 07:38:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F51295B; Thu, 15 Jun 2023 04:37:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 309A3638FE; Thu, 15 Jun 2023 11:37:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6598CC433C0; Thu, 15 Jun 2023 11:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686829072; bh=UUu1StOTrnywNSnI1ET77NI5c2yanT+lQF7XZliwvy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQl3CT/yN2JWADl7CfUjbDHrnyhAjcDjNlvlz5UJoN1VshswO5aN1qXeBoE8inMdc eUrTmp4fhBfdQWQVPapprmbcnfNFZt6hYHQFXSpwPhgPMLqnlXNs501oxpjjCrEqYx FZVYgEgORn6/rXvLGMOu/bCh0GFy5n1QFJg2szjhNCXZ8MkCzaA3xpDB/a1dsElHYJ Fbf12/PV1voqa5st56xTHMF0hUVAYcVSCM9oTNXgj8XgdzhzxjiQdbPcAIvs05/EKK NlaJG1T1rH9tHDz+1Z7DHo7+D5g9hl+yHFWmUevGq+AFdNWlWTZPn0K+sOYJppPBCR moHgT+eqLAfGA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Steve French , kernel test robot , Dan Carpenter , Sasha Levin , pc@cjr.nz, pc@manguebit.com, ematsumiya@suse.de, lsahlber@redhat.com, sprasad@microsoft.com, vl@samba.org, metze@samba.org Subject: [PATCH AUTOSEL 6.3 09/19] smb3: missing null check in SMB2_change_notify Date: Thu, 15 Jun 2023 07:37:09 -0400 Message-Id: <20230615113719.648862-9-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615113719.648862-1-sashal@kernel.org> References: <20230615113719.648862-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.3.8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve French [ Upstream commit b535cc796a4b4942cd189652588e8d37c1f5925a ] If plen is null when passed in, we only checked for null in one of the two places where it could be used. Although plen is always valid (not null) for current callers of the SMB2_change_notify function, this change makes it more consistent. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/202305251831.3V1gbbFs-lkp@intel.com/ Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 02228a590cd54..a2a95cd113df8 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3777,7 +3777,7 @@ SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon, if (*out_data == NULL) { rc = -ENOMEM; goto cnotify_exit; - } else + } else if (plen) *plen = le32_to_cpu(smb_rsp->OutputBufferLength); } -- 2.39.2