Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2677679pxy; Sun, 25 Apr 2021 00:46:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW2JwcB+hOzGbJcPHcTJM1S8EFaRsny9Wihut45vjTAbK7UFaA2QTILbFjCVuoqT119NkI X-Received: by 2002:a17:90b:2291:: with SMTP id kx17mr13588272pjb.79.1619336802650; Sun, 25 Apr 2021 00:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619336802; cv=none; d=google.com; s=arc-20160816; b=ATRIzzfkXos1bpED/9PpaIu1nl04VpqJCLisgyvQ9jBl+ApekimPBp86OeKiXnGFY8 xsfIWiIoI3uOPqPUMR0ab7gw+6fRBD9y1Po0+YISnlmDs1sTcO02HPpcvK8UdCqOpFPG nKOkILAoJrs/9BWNduycPrQsFEY7GsT2EMUe201eywr/BGgfn/xevOnWfGZUVYmjUlOJ kmQtWY6ACz/IPN1kGy6EEoYyEFrKDlxkR/QxaADEy9LJABbmoElPaqDIIcoZty/6bkvW r/Nnekz9aCWlZPuwit5Rd961r8qxS/B8MheLayVnS2yYP4k/eLaMjXOdVxmjsLF/LIIu PxGg== 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:dkim-signature; bh=M0ShZ+VgTC4hGFkGb8SaDtr6ogRfGJGiJKk9ryazP1g=; b=Z5kORc4i/EToayEEzylpXVXqecBFrBZ++PCJXLGZpNFO81z6rIkz8VF0ec/dORlYkk dDgia7BHPOVjKopVVBEyk+9iF/3hu/F+RnCTVcZ7jJqmOftF6SXKwMp2WE1Xr3j2usPg Z6MPTzJ/Fk2OETa3E8eOoPwEfM9ovim9o3jy65YAjQiSb3iDJoWZeO4x8RtSeXSZ/f7v cD2EgQqmHnAlOpNQe7gsE9zj0V+OC417psF53jT0Xo+ucahZoenSz/MtA9XP4CvsnKMf 2HbhprIgbYwXoQVKOqklOfXGvpRXjDc3LsbhPmefIdlPtxQWZFgo5y6DtWBAR5CvInOJ s2wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="A+//hf5+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si12553650pfe.311.2021.04.25.00.46.29; Sun, 25 Apr 2021 00:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="A+//hf5+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbhDYHpa (ORCPT + 99 others); Sun, 25 Apr 2021 03:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbhDYHp3 (ORCPT ); Sun, 25 Apr 2021 03:45:29 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271E2C061574 for ; Sun, 25 Apr 2021 00:44:49 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id 10so1489480pfl.1 for ; Sun, 25 Apr 2021 00:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=M0ShZ+VgTC4hGFkGb8SaDtr6ogRfGJGiJKk9ryazP1g=; b=A+//hf5+KkICzKb5BXjmnB1Jl8a0I33AkCtcPKJMQDvPdk/yellZ6MRoePlwPGW3NJ hpY8NTI8TewGR63AvCXmEKBzGXzGJZYVKvj2/606TM/f8IhHUs+skKiBpDYD+SGnX2r9 RjI5fF0C8hjct3uBK+yLlnu2ji/KOf5sxsB9hjMuaYXCgs8J8TK2nPExSf1MBYLdHdTz r6W1ZJb1krV7p+5pHLTIacaNf/LSWj2XF6lXjfzR0goQtFta7ynepfAzUVnzwM4qdYfl VDPz6L38b+a+dtNORY3+LYopynDp4Xaw8XJScG0utFu50F/tsXTsWmX4++pHYVyLLGXH XT0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=M0ShZ+VgTC4hGFkGb8SaDtr6ogRfGJGiJKk9ryazP1g=; b=NrEkiGYFxQuT26hzKvq2H55g6aLSsyErmqgZxpXodPsZ05pRIuzQdnDBkRvLrNkSfW MFKYT6brbFEzYxtENnhwHtM3il8mM83Y6C6P7Ie6mdxQ/a9tb552aNOWvSFX6ynRZk66 mOK5czdk4OQuO4KAVllFtLxMJOvBGK8VZiMwCiVmtZ25I6JFeFaQZ3cpaCXx0/vImoy1 FPhU94tBzdH7BsaVasKR0kEiLcouFSY1f6YdO/rlQAJsA+XJb8MFLb07AMlcFtGqvDD0 T2Pz3fdelGZqR4/kzYFl5w2q6hqBxoewn61T3tT5/v7lpOmnC99V51TMgyMnFKvBvxjT iqxQ== X-Gm-Message-State: AOAM530WB7ySuhuidVJIMwhTAZ4n0y8ilwWJEAPjpH2BFAEciBLuTgoO xobkaPJQxMVOTyjAiEhQ2bS48LRHEphVTNyV X-Received: by 2002:a62:86c5:0:b029:25f:4e63:223b with SMTP id x188-20020a6286c50000b029025f4e63223bmr11708420pfd.19.1619336688536; Sun, 25 Apr 2021 00:44:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:9004:6b9b:1106:23bd:5fcd:29ca]) by smtp.gmail.com with ESMTPSA id 63sm8215615pfx.202.2021.04.25.00.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Apr 2021 00:44:48 -0700 (PDT) From: Dwaipayan Ray To: joe@perches.com Cc: linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, Dwaipayan Ray Subject: [PATCH v2] checkpatch: fix uninitialized return value in raw_line subroutine Date: Sun, 25 Apr 2021 13:14:50 +0530 Message-Id: <20210425074450.6902-1-dwaipayanray1@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case the second argument to raw_line subroutine is 0, $line remains uninitialized and is returned back to the caller. If the caller then tries to perform string concatenation with that value, checkpatch throws an error: Use of uninitialized value in concatenation (.) or string at ./scripts/checkpatch.pl line 1960. Fix it by providing an empty string as the initial value for $line. Signed-off-by: Dwaipayan Ray --- Changes in v2: - Change commit message scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 23697a6b1eaa..a98217360375 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1943,7 +1943,7 @@ sub raw_line { my $offset = $linenr - 1; $cnt++; - my $line; + my $line = ""; while ($cnt) { $line = $rawlines[$offset++]; next if (defined($line) && $line =~ /^-/); -- 2.30.0