From patchwork Fri May 26 00:15:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 13255791 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 42E29C77B7A for ; Fri, 26 May 2023 00:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbjEZAPz (ORCPT ); Thu, 25 May 2023 20:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbjEZAPy (ORCPT ); Thu, 25 May 2023 20:15:54 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34B5F18D for ; Thu, 25 May 2023 17:15:53 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f4b2bc1565so85862e87.2 for ; Thu, 25 May 2023 17:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685060151; x=1687652151; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ZfhJaqPyjefpsKuZf0KN4c3vpMY0NKu2TD2PSGpqS8A=; b=gqGCWt6WDQ17bGEUG7Gleu5D3Bdv/HM48cSbxH9GZpRHRAv9z42DqNi2z3lgOs5V8s JzNTDhtgM+7sJ8qQ7bOKDPuXHjyp4PAxaNniSylg5/mlIzSLwj59tkhhRIwS0fCXJvnb yl352wn9G2zOFqz3xZPNOl7RdmZmlcnmXCThsXomkVWWZSM46Bgc0xujUfLL0JECX6HO LvGqaxP5Z9ny3ucfuaNi6taTzKqjrmiNYWi6HrYAM+/I1hWxza05Pab0GcXegasK7XF5 l8jukyTUkB6pCF6sfHYzsaXl5n5p6uWMhXgVsKgOFC7TLqgdgo/sLrNZIs8hh/nV8rXL LqGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685060151; x=1687652151; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZfhJaqPyjefpsKuZf0KN4c3vpMY0NKu2TD2PSGpqS8A=; b=ORySrs1fjcT/0eJwXbOE+2aAyNwSU9bB5biU1Crpruq/ayu1zb6+vFanhNLmM2pigW PGbROHpr4SEWE20Zoc1emkxB67hGEO1rGH3/KIoUGEb7OS8UjR0zFF2IyOG/Ia8obm7U +qPhMUm7QvfUj7qr4xFfphiob0z/tGfT4XPiAnxpangPfYkMg1/zEsXtCIZlt/WfdSE1 qCLDGLgKGuvCTZabiAuU7Ih7SA/HhHA+1E/p1ZF4ctlUEaMcPQ8RZwBmCe5afWneViPj o/giLenQ+IGNtbRL0lEga86FTBrAj6twZzqE6zyns84zUcL5uetPfORdaCeMGm/oYwTr kLEA== X-Gm-Message-State: AC+VfDxnP2b7A6evGKH+fcLsEIhkxORtetxKdJQ0wmPuMTHizMiYvwuV 9Ew00nKCySjG5SwKxEGbF56dTY2UflgapCgvni2QuYcI8sxDMCR9 X-Google-Smtp-Source: ACHHUZ6LE8cIz1gksl3d2AS1aneBPslU+v1yoAVpw9fY2RxinOzLCP3VC/QrWMqEn062CA8t64vEn2IASjzMjc1dPtc= X-Received: by 2002:ac2:547c:0:b0:4eb:3fb2:c56d with SMTP id e28-20020ac2547c000000b004eb3fb2c56dmr6616116lfn.12.1685060150812; Thu, 25 May 2023 17:15:50 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Thu, 25 May 2023 19:15:39 -0500 Message-ID: Subject: [PATCH][SMB3] missing null check in SMB2_change_notify To: CIFS Cc: Dan Carpenter , kbuild test robot , oe-kbuild-all@lists.linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org 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/ From ea162858c5159a6052bef3fe5198c24e0d00cb6c Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 25 May 2023 18:53:28 -0500 Subject: [PATCH] smb3: missing null check in SMB2_change_notify 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 --- fs/smb/client/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 9ed61b6f9b21..7063b395d22f 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -3725,7 +3725,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.34.1