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 9E996EB64DB for ; Thu, 15 Jun 2023 11:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344200AbjFOLk4 (ORCPT ); Thu, 15 Jun 2023 07:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344134AbjFOLjV (ORCPT ); Thu, 15 Jun 2023 07:39:21 -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 200033A98; Thu, 15 Jun 2023 04:38:34 -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 E95A1638FA; Thu, 15 Jun 2023 11:38:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 313FBC433C0; Thu, 15 Jun 2023 11:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686829113; bh=mmdudRkuSbiUU5LPtsxAkTPhX5voY/Mn+ojKMk7dSZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwZQ/HLMttogt2rqrniQHwDukRaay1tHnkrZ07T1rz1tGSLKq2vfy4sXZQsi1Ls6p uCdtDyYGlKL9oWffkWQsUpdSMcyUqMOwksvbfIPpRE76OzYo+IOYBv7mqa5ycsKOcZ xZBZaTPuz/rxUgQ/I6q7bgJIGO7gVJ+qEAf8Go3ymu6L5tXDGFoX3HW43Tkx/NWeSm 0CaYB73ho/CONjjLD18TYM5Kxjmw/a0g60GA+w9iY/5fnIfShovCVhFmRTmUbwNdzh 7nyXIcVbWsDA8mYq+8DBVWfTrKrhmBtgtMDN8ZNzjh7Ntazh5xI7b9yrVtSN3S4mtn SIFuTUADiimUA== 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.1 07/16] smb3: missing null check in SMB2_change_notify Date: Thu, 15 Jun 2023 07:38:07 -0400 Message-Id: <20230615113816.649135-7-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615113816.649135-1-sashal@kernel.org> References: <20230615113816.649135-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.34 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 537e8679900b8..3ca593cdda76e 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3779,7 +3779,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