Message ID | 4aa9b897-4596-4e2c-8dda-f24ab51e9b7c@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=TGndUzxI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=EXHCqI5l; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WKr3W5TxJz1xqc for <incoming@patchwork.ozlabs.org>; Fri, 12 Jul 2024 09:07:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:From:Cc:To:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PcuEfVatrjhhrZ/MrxLpY6lVuS399Bv2v4il3v66A6g=; b=TGndUzxIeCH8eu 4l/wfjkJVIDf1XHQZYdxsGz236KQcxQHKaJjs3ZC5+DC209tnv1RJ3ISaF4+wJxhl0lMbxoGxm3Zs +IQFdMvN9yRebHdjeohfqJ37kFrm/eFbYWiAaH0iu5Hru0CdyoGvLqmdrfhlGwmQo25t46mplnt8E yykHZxkC+tYg2cMAiknYOc3zLD/POq1Inkk2syWbtvvaRLsdY/6H0+7vHdHGUkQq7kA7VOiRn+6S9 pXpQtjwNeA2z6iEpyYVEVJk3lNRYsH3254UA3orLcL0JIglq3tyH1B8qVPzohEterZ116jhOZJDLz dZvXk8kJhJCMPRR5wrFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sS2sm-0000000FmCl-1Qzm; Thu, 11 Jul 2024 23:07:24 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sS2sj-0000000FmC7-1r3N for linux-mtd@lists.infradead.org; Thu, 11 Jul 2024 23:07:22 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5854ac817afso1814676a12.2 for <linux-mtd@lists.infradead.org>; Thu, 11 Jul 2024 16:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720739238; x=1721344038; darn=lists.infradead.org; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=byKCeNwRs0T1R6plp9OuqfAkOz/elWWT8jqkCBg7kkg=; b=EXHCqI5lLgWWDUOlfMxnTNC1yGgpLGgnEAIHpllx7Zq1S7q257t2zlmd478ixMzXnX N/Olbq/nw2Bsamp5hN6jJU65KBAVrSXDRP7FkGGAAzTC+xHGJRCodpnwqwCMPgTQ8CBi vOk5uKDFgDO1S7Br6bJi1rkBFjNlHrY68dEY+m1J+IXg13NnQl75Ep4G8HYCPePXyfYY /dV/2iEHpJh7n6lRJ9rOR190TWEiJyRP+THKMPrfYEyvlT8XCXaCey1s+1q5rqdUqZng 5GKgp9V506uTMxrqWbjlPiA/VynFY0JDUV81OgN3wayLm5GehmV5PJcqGstpjlwGMxzL Txxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720739238; x=1721344038; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=byKCeNwRs0T1R6plp9OuqfAkOz/elWWT8jqkCBg7kkg=; b=wHhesAzz8IE4EIcz3bLKnlZPfgGh4VQpprqcEwXfC4FVESr5i9y/TAKNxM2mZb/ycn lpZ0KP2YuKvOkSDQrD1RoF4cjkvmOzm9Xe35AlelEWd81f1ZDb85HxqqA2XVOv9NofMp SJ38cL8dze5HdSdnzMPfyv72jcNfqWqtGrLZeWnLClqIpX6aOWc8E1iCIomYcB1HHvc6 QJkej4HAncGP/Xd3xKxP9P0xi/368EVkjP71okGCiPWnPN1ozyf5NCRwSLzoPL4lEtRt 4eX2oGtmx26TzRSDgg/Li7+Zai6OJiIIU9fapdGbwa0YhX3GeV8Kqef+rGowL4ETHYJm IleA== X-Gm-Message-State: AOJu0YzAECEOx8f7fyQuMO6YlDReQb5Yw3T3+ftgHCQsjJMlcRXp0Rh8 TcChyPkztHv2+9WYUlz5WMAunXcuIwXicllHVoklZ4yjzPl2VNVFMi4UTA== X-Google-Smtp-Source: AGHT+IHTbjG/RYmwHcT/Q3lMtncGYloiLd+y4K3oAC67A0D4AU6O7kPZeN9IfTq1U1PJ5DxsO9o1cg== X-Received: by 2002:a17:907:3d87:b0:a77:d52d:5c61 with SMTP id a640c23a62f3a-a780b89ea27mr804898966b.69.1720739237926; Thu, 11 Jul 2024 16:07:17 -0700 (PDT) Received: from [192.168.178.20] (dh207-43-148.xnet.hr. [88.207.43.148]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a6bcc52sm287890266b.4.2024.07.11.16.07.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jul 2024 16:07:17 -0700 (PDT) Message-ID: <4aa9b897-4596-4e2c-8dda-f24ab51e9b7c@gmail.com> Date: Fri, 12 Jul 2024 01:07:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: linux-mtd@lists.infradead.org Cc: Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org> From: Mirsad Todorovac <mtodorovac69@gmail.com> Subject: [PATCH v1 1/1] mtd: slram: insert break after errors in parsing the map X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_160721_503967_2A225B15 X-CRM114-Status: GOOD ( 10.32 ) X-Spam-Score: -1.8 (-) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The GCC 12.3.0 compiler on linux-next next-20240709 tree found the execution path in which, due to lazy evaluation, devlength isn't initialised with the parsed string: 289 while (map) { 290 devname = devstart = devlength = NULL; 291 292 if (!(devname = strsep(&map, ","))) { 293 E("slram: No devicename specified.\n"); 294 break; 295 } 296 T("slram: devname = %s\n", [...] Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:52b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mtodorovac69(at)gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [mtodorovac69(at)gmail.com] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
[v1,1/1] mtd: slram: insert break after errors in parsing the map
|
expand
|
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index 28131a127d06..8297b366a066 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c @@ -296,10 +296,12 @@ static int __init init_slram(void) T("slram: devname = %s\n", devname); if ((!map) || (!(devstart = strsep(&map, ",")))) { E("slram: No devicestart specified.\n"); + break; } T("slram: devstart = %s\n", devstart); if ((!map) || (!(devlength = strsep(&map, ",")))) { E("slram: No devicelength / -end specified.\n"); + break; } T("slram: devlength = %s\n", devlength); if (parse_cmdline(devname, devstart, devlength) != 0) {
The GCC 12.3.0 compiler on linux-next next-20240709 tree found the execution path in which, due to lazy evaluation, devlength isn't initialised with the parsed string: 289 while (map) { 290 devname = devstart = devlength = NULL; 291 292 if (!(devname = strsep(&map, ","))) { 293 E("slram: No devicename specified.\n"); 294 break; 295 } 296 T("slram: devname = %s\n", devname); 297 if ((!map) || (!(devstart = strsep(&map, ",")))) { 298 E("slram: No devicestart specified.\n"); 299 } 300 T("slram: devstart = %s\n", devstart); → 301 if ((!map) || (!(devlength = strsep(&map, ",")))) { 302 E("slram: No devicelength / -end specified.\n"); 303 } → 304 T("slram: devlength = %s\n", devlength); 305 if (parse_cmdline(devname, devstart, devlength) != 0) { 306 return(-EINVAL); 307 } Parsing should be finished after map == NULL, so a break is best inserted after each E("slram: ... \n") error message. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at> Cc: Vignesh Raghavendra <vigneshr@ti.com> Cc: linux-mtd@lists.infradead.org Signed-off-by: Mirsad Todorovac <mtodorovac69@gmail.com> --- drivers/mtd/devices/slram.c | 2 ++ 1 file changed, 2 insertions(+)