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 X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C683C433DF for ; Sat, 11 Jul 2020 15:44:31 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02FB0207D4 for ; Sat, 11 Jul 2020 15:44:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lmwtV40H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02FB0207D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CC708882F4; Sat, 11 Jul 2020 15:44:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E-U9yGG3KLtp; Sat, 11 Jul 2020 15:44:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6FACC882C1; Sat, 11 Jul 2020 15:44:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5DA7DC077B; Sat, 11 Jul 2020 15:44:30 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id ED60CC016F for ; Sat, 11 Jul 2020 15:44:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E7231882D0 for ; Sat, 11 Jul 2020 15:44:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g2zxSSQwo1fa for ; Sat, 11 Jul 2020 15:44:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 48360882C1 for ; Sat, 11 Jul 2020 15:44:28 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id k4so3450173pld.12 for ; Sat, 11 Jul 2020 08:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=Au6aiTRw08Q72MSMSmqWp3LyAnylpWu6UmqO8Wi+Ego=; b=lmwtV40HwnY3XuswWMKrKFIw/SF/4z4GYhGo0Kl18ArS5MMS+4Oz3q5C43zKaf7WiF RR1jimMzZAKKhQnp9iY2JN074lewjp2fCUecfy2zz7M60nI4411r6kH2VRcugNXxq0vV CkLApBtFk9YdNySmbXAVgTvwdgp6CwdEUL0rq0soeK2brf5Z38NYE5YzglSpFxgMdgMP 855TPiEe4QHQajzpqf9r1LXaOTZoZ7mRoD67k8CAHjnykY8vU/rIHuu77gOWzUzmmtFV M7HKZw5NvKA/Rp0uAh6/6ORdwLxGRt5cLNKhJ3PFHzkFTfbKJx6MOuVYJiZnd2L87ZRS vS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=Au6aiTRw08Q72MSMSmqWp3LyAnylpWu6UmqO8Wi+Ego=; b=QMcaxxvIrHP/0/eVE7WW+tVaqf9lXm/1S6zeka7nzc/rQKCzJPXOrHWh1D5Mz8aSsg g9QR0kyvoM/Fz1J5iNrST4I0eUwG1utL+HNO7BBGtMcjmPvs1eoxnOABaCA5OeJy6EcJ 5x59Ohis4n24l8/WNXMfui88pa48GuH4QieUrJpXzRWrGf9x3cSuVXL1/RvOhuQKIAjj XkCTOadXDb/DGHVdPmZZY6ygafHQ3XrmAxr3ImW0eI/gDJ0ZBh/nGjgj6Syu1PMyi7hp 6+JQYluCROrBKIOeoI8ansbRbFYGmLFT9/NicCfU6tEg4qDImDwZYTsqwcVNKi8pklmH qekA== X-Gm-Message-State: AOAM530vkwXFNphAWiKcSTQ1aFyJSsJbPBLkMeOUMb6+R75HfbIOW8ey Itf/gOSMuCF1vOo8toMU3+k= X-Google-Smtp-Source: ABdhPJzM3Wl8w8bIWDw03Eveo7/3y0XM9yPyuLb0rv1weHrjrxWbQfUmeK45FfwnStetiABHd/hKuw== X-Received: by 2002:a17:902:369:: with SMTP id 96mr42976988pld.214.1594482267764; Sat, 11 Jul 2020 08:44:27 -0700 (PDT) Received: from localhost ([2401:4900:1692:3ec9:9b26:ea4c:abcc:4fa0]) by smtp.gmail.com with ESMTPSA id p12sm8199576pjz.44.2020.07.11.08.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2020 08:44:26 -0700 (PDT) Date: Sat, 11 Jul 2020 21:14:15 +0530 From: Mrinal Pandey To: lukas.bulwahn@gmail.com, skhan@linuxfoundation.org, Linux-kernel-mentees@lists.linuxfoundation.org Message-ID: <20200711154415.34w6ndu24uodj3ba@mrinalpandey> MIME-Version: 1.0 Subject: [Linux-kernel-mentees] [PATCH] checkpatch: Fix the usage of capture group ( ... ) X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2426142444518393565==" Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" --===============2426142444518393565== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fsxm6yeysf7h5u6s" Content-Disposition: inline --fsxm6yeysf7h5u6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The usage of "capture group (...)" in the immediate condition after `&&` results in `$1` being uninitialized. This eventually crashes the script. Fix this by placing the capture group in the condition before `&&`. Thus, `$1` can be initialized to the text it matches thereby setting it to the desired and required value. Signed-off-by: Mrinal Pandey --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4c820607540b..e73e998d582a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2636,8 +2636,8 @@ sub process { =20 # Check if the commit log has what seems like a diff which can confuse pat= ch if ($in_commit_log && !$commit_log_has_diff && - (($line =3D~ m@^\s+diff\b.*a/[\w/]+@ && - $line =3D~ m@^\s+diff\b.*a/([\w/]+)\s+b/$1\b@) || + (($line =3D~ m@^\s+diff\b.*a/([\w/]+)@ && + $line =3D~ m@^\s+diff\b.*a/[\w/]+\s+b/$1\b@) || $line =3D~ m@^\s*(?:\-\-\-\s+a/|\+\+\+\s+b/)@ || $line =3D~ m/^\s*\@\@ \-\d+,\d+ \+\d+,\d+ \@\@/)) { ERROR("DIFF_IN_COMMIT_MSG", --=20 2.25.1 --fsxm6yeysf7h5u6s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE8DwCG1PwaC2uTI99xIwpEWwxhGQFAl8J3kUACgkQxIwpEWwx hGS2YQ//Vt8Um/2jIEPwEKcasEvdt/sgRe/XjwdvA0gEnDqSQeKypSRHSsuZLoFV 3EsuNE8hq8Nul2Kh5wQPbPC4BVqUkd4emGFJhzNjySy6MqdJIKxn8F4plUfdQvmP LgR+52jADl7jPgKt+BRXQpWJwjvF7GCBoR6naySHG7qxxMvLBpVT1PFFfwcBU+fC 8Uzi+xTwz9gONDGMyvIj1duSx/Av6uZZgu1SXn6d8Cu+KOAQ70fGahyPnRjdzXWO q/0P5iR745GwzN6IPYNPrz5gOHtogxyFm37zYg1CfwHRAzPm7+5APbdYo+SWZEGx HKMGyKpS2HaDeoooNHsQuX3extmvTbnib4+I+nzu1TWE5cdpyVgCwqrDCkHFNv6j Mmk1SFXLLj6o1ebC6CLUNgM3RRXFLW1Ez5mBFHGZMa2qahM+z64O84pGYmpvzRzH 08CVWH7sjJMTbx68wovxth0NM8Z9M/uXghxemStPL05plJKx5SVjKCZSFn54Q7Pm zuTtOqhkOKsy4Ix7+2ft5b3Tm5GY4MUAh4+UPQDVj7MCiGBxah3MFahjLeJZNnkp +UGW/FFFLrMriwQ4nQfZJxKZ5fwNqjCfZjLdvZl3AmoKfaTNdWAl+502rjpeNJ7P 5/OgIM5rKFBISeK5IQiHN6gYUvS5bXFEMlcKpGSRmnUA1sPpFXA= =JW3z -----END PGP SIGNATURE----- --fsxm6yeysf7h5u6s-- --===============2426142444518393565== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees --===============2426142444518393565==--