From nobody Sat Feb 7 17:55:31 2026 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE4BA48167F for ; Wed, 21 Jan 2026 15:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769010861; cv=none; b=g8yfJJJU8KmB5es3VmqGCeZtw0uSdROO4AJJJXye5GYp89PNY59TfjJQSEzq5uLsbSUzoHOj4vP5Kg+N4W5SUY3CPpAwV26MI7BwOxLeWH6S2iwNVCRW0Cc8RlztLcCbkzbE/cHqSjQExqi3aKxOVQdi+PM0wuIfFPIjJrsE7bo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769010861; c=relaxed/simple; bh=glartZGclAK5FXJvyFUlJJGdosWEu4ppdxvjpVhv+5s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rc/w+jGQrYq5GHuUY4+o+pG7Sfyl4EH3UZSD7rSDbBxKfbZIM235IfqcpDBx94CI5FghI3fN0705WXFhRNxzCE7srceUJNBRUUdwr2B9ZdaFlP8uZ1Yz295ywn6+RAxhlPuHY1Ki1D6eV5uD8pG7JQGml6CPcaoVJtMadXlB9x8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cGeUl8f3; arc=none smtp.client-ip=209.85.215.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cGeUl8f3" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-bcfd82f55ebso482367a12.1 for ; Wed, 21 Jan 2026 07:54:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769010859; x=1769615659; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nuD0SbQcxJhlrMah0Jeffm4oSmypOkZ5/qjE/QZj8s0=; b=cGeUl8f3t21nCxElJle8iVybKvYBAEwFDJcjaSp2wWeYGbPS0UkhvZ95/nvBFwtQiT rZD+6r4H7GRhEc8w0ATq7hXJewswUIUMvFd632TJxpNqaE2t+nz/DaYUI4AoyP2st+Oy h9nPYvrBuYGnWy6bvRIIGIQ/m2yawPLSZI/H0xnhDVMbrGDlXZ1S2UMU74hTQErsLOHe GKWavd5/Rs2oIfRy/LGDXKKBIGHZfE18Wc72PnDrpBbZEH/RDqK617z4GXoDdPwvvwrF NRfLHdIZZkkBlRpaKp0E6Z289xxlyXVwL9kZ+1UrNk7+bzrU9zr34ngTVfjAN7ZMW6wk cmFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769010859; x=1769615659; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nuD0SbQcxJhlrMah0Jeffm4oSmypOkZ5/qjE/QZj8s0=; b=t/xD6j6UEjkHLAW0C2Q/sdYAn6Ri/Xj/mmTICNrQRVaCxck62PwhuRoMyYI39K55uT YHfO/Zk8DL0g0uvN0H+no8YiUNxFhrF/INWpqAptMXbOoqdiw+2lzq/an1eEbMgMA8v5 LyET+5XFKxXedLhEaaA2uuXau6GZ1En3eMVF64QFv6m10zj9LqzFRM4s/Pp2LnlWLImh FbaOKnsJDvQOorwrmlMpNSyG/5+JXAy8qRYtW2j2dqT5KyiEeCB4MD2VLdvfd3+8X04f EZ9k8Mbozdztc4e17rsFl3dLfjJM4JyrryGhqsZuNVN1sIpzETPIZ0ntj2s0cEQnWwMA /S7Q== X-Forwarded-Encrypted: i=1; AJvYcCV+CJJuv8Af66gSOr/8IZyfgXVihGkyDrxjOuM9Ad1Rza9sP2xrpBYed/n31pN1kH2weNhmrZtFBFqn1bg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy04UCo+nR67Ai4NVIoPdURROfTEeDHSS3jAz5Zq5ZuYvJsNKaP Rq1MBOctIx1EUsaNkKDhUo+m1rYKt38itfEOZBpRG6lf+KrVtL7wN2JE X-Gm-Gg: AZuq6aIymqoLoHKk7mYivOMIja5IaRU62sVi+LGT7cT1C0eJn1Y4r1Y+CyxZC9NZrIC 6X7H1Y5+IlSy6EohR2eDltlgixtzgRazfKyifexleGsU4CI4rpYYerwyZCLpDKsX4z0pwKz9axw Xv9h4OregGkt8t0OQNCOVuBMUm5EMhZDuN6JSslPpZ0uWqh2EzA3tK+ehK0CCmu0NPzi+IHIUWj pu8Ong+6lCyOeV5LXS7jWLSv3uKaQBPndSxE5jasEZgkZ3bMXTtRgedd/7O0M74rAS212Ca88pc Efa7k/tYHkOwnchmNihoiAqATIc+NScGgkebHwBIRY9MGFIm18pjNxZPT1cnYwaARERFw3vPl8b YI3f5HuaqHGwHcVJ9fFuY+MPoFz2lE2e7zK7U7E56B5/mGuL9o7BxjvgiB1yq1Whk233C4Y2n6F wA7YJcaN2+lxj1La3SSxE= X-Received: by 2002:a17:903:124d:b0:269:7840:de24 with SMTP id d9443c01a7336-2a700a32cd4mr156255585ad.21.1769010858813; Wed, 21 Jan 2026 07:54:18 -0800 (PST) Received: from localhost.localdomain ([58.29.79.238]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a7190ac779sm156336145ad.21.2026.01.21.07.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 07:54:18 -0800 (PST) From: Lee Yongjun To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko , Lee Yongjun Subject: [PATCH] serial: 8250_pci: Fix uninitialized variable use in pci_oxsemi_tornado_get_divisor Date: Thu, 22 Jan 2026 00:53:52 +0900 Message-Id: <20260121155352.52489-1-jun85566@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Smatch reports the following errors: drivers/tty/serial/8250/8250_pci.c:1246 pci_oxsemi_tornado_get_divisor() = error: uninitialized symbol 'tcr'. drivers/tty/serial/8250/8250_pci.c:1247 pci_oxsemi_tornado_get_divisor() = error: uninitialized symbol 'quot'. drivers/tty/serial/8250/8250_pci.c:1251 pci_oxsemi_tornado_get_divisor() = error: uninitialized symbol 'quot'. drivers/tty/serial/8250/8250_pci.c:1255 pci_oxsemi_tornado_get_divisor() = error: uninitialized symbol 'cpr'. drivers/tty/serial/8250/8250_pci.c:1265 pci_oxsemi_tornado_get_divisor() = error: uninitialized symbol 'cpr'. These variables are initialized in the if branch or inside the loop in the else branch. However, if the loop finishes without finding a suitable divisor, they remain uninitialized. Initialize 'quot', 'cpr', and 'tcr' to 0 to prevent undefined behavior. Signed-off-by: Lee Yongjun --- drivers/tty/serial/8250/8250_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8= 250_pci.c index c5a932f48f74..b32d7e03c29a 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -1200,9 +1200,9 @@ static unsigned int pci_oxsemi_tornado_get_divisor(st= ruct uart_port *port, unsigned int sdiv =3D DIV_ROUND_CLOSEST(sclk, baud); unsigned int best_squot; unsigned int squot; - unsigned int quot; - u16 cpr; - u8 tcr; + unsigned int quot =3D 0; + u16 cpr =3D 0; + u8 tcr =3D 0; int i; =20 /* Old custom speed handling. */ --=20 2.34.1