From nobody Sun Feb 02 16:26:01 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YmFP60HD9z5mM4K for ; Sun, 02 Feb 2025 16:26:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YmFP56l5yz3Yl9 for ; Sun, 02 Feb 2025 16:26:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738513562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QghoSwmz6riXMdCD5ZfjHsKw7dn8+rMSq67DtoY/gXU=; b=WtQ9Bpx2l9vYwnh0Aze//SyUb17KVc5GS15yrrXZRrbZh9TDvBc6CKnvzjtkSaYvladLEZ JoiNhJ+ib9f2G0Jnuar5Da4BSpSrLISuz4ZuuRzJGkAJoAY/gikjOIJHonHLi+8/AX2Hkh WNZvL2IyO9Hr3/hUj7nIp9Q/4l4nXOMnUrD1JeVGCwVP9GDQ9qkHOr9nT9XpwKJAg2dPnp ewxhWz+f4YmWrsUfZ3YwvNzkPEDI9Ehl/V/+PQ0Ahac/X3e2vhE7tU0zkpEaX31fiH3lYZ y1Ha61jhSIFa3eNlXWibQTevOli93A9GzOcifYOd8DoBDcxdoZkSIGzgWCBglg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738513562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QghoSwmz6riXMdCD5ZfjHsKw7dn8+rMSq67DtoY/gXU=; b=h2cq9M9BefyXC75pDQBxginsw8AMjnW6wzYiDSTDOFvHiIlo+FKsBXyGbgA776Gro2PXw2 YqPpB+P7yMUiW60gJK2UCA0VgjgF9MkiE1hRjdLZNsJ1TwC6Ww0ADZd8yAHybVcSJDWmSs ScfagORs9FtX/7AMzn5pS15412C5a7ENGwGpAVItB0dpUn5Aro6lW/SwdoqJo3ZnTc2ygs wAdLHYyYb//HUEPLcUDePqwbw0NmrTmV3prpAHuSomWR+V75OhaVr3DTsEtCnF7HicMXQM o7AoN7WUbplmi1Tl4HpVXOVAQGTF7ikDmq6LLBGfg0W9wk3YFhZ42m2sJ8M/TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738513562; a=rsa-sha256; cv=none; b=DMBii4lkAIQS/FphrGExi5OXDBnvkDrWmJ1PQ5YVBSAUW+cCLietSfN1ULbIThTbI9kshl fpA6Hmou/2moEWSy9KOS/6O5xSCUAwmYz1wrynLkKCL6m038WiKXjVzfv5aeHaEmGBOHxT BOTdl1qh+l0rmEP04G/rX9ZKlondSCpIZ2PCmCejBzOWihTPOZwD+WfQcGnm841jWJs+YH Ozf6lHmKWsj40AGWQrm1SQDg9W/6sLosdIFk8/QlDZXBJEJ70k8qXnR2CRLI3AKhRU5OIt xTpLxOdmG+dgKlkk9QkfiYoT6gvU53NJgPVbKGcODFD0AnDAonXccpMia6fe0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YmFP55vLWzxp4 for ; Sun, 02 Feb 2025 16:26:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 512GQ1rl026831 for ; Sun, 2 Feb 2025 16:26:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 512GQ1io026829 for bugs@FreeBSD.org; Sun, 2 Feb 2025 16:26:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 218002] sys/dev/mps/mps.c: PVS-Studio: Dead Code (CWE-561) Date: Sun, 02 Feb 2025 16:26:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: imp@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Not A Bug X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc resolution bug_status Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D218002 Warner Losh changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |imp@FreeBSD.org Resolution|--- |Not A Bug Status|New |Closed --- Comment #1 from Warner Losh --- So this bug doesn't matter. sc->num_reqs is used only to allocate commands and free them on detach. On a panic, neither of these paths is used. So it doesn't matter if this happens before or after the panic. It won't affect the panic. Sometime people make panics advisory (not something in the base). In these cases it's not dead code. And honestly it doesn't matter where it's set. Also, there was a though, ages ago, that this shouldn't be a panic. First, = it's a relatively rate situation. Allocating the DMAMAP at this point in the code should always be possible, except if you load the mps driver during a severe memory shortage / fragmentation condition. Second, the driver should be abl= e to cope with the fewer commands, though not as efficiently. It's a no win situation, and as the comments state, it's not at all clear this is a fatal condition. Some users have run with this line commented out. So while there's nothing wrong with this patch, I'm going to reject it and = the sister report for mpr. It's one more change to the driver I have to test, compile and spend time on that gives no benefit. --=20 You are receiving this mail because: You are the assignee for the bug.=