From nobody Tue Jan 24 22:14:36 2023 X-Original-To: dev-commits-src-all@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 4P1h8r5TTNz3bgjF; Tue, 24 Jan 2023 22:14:36 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1h8r3NdTz3MH1; Tue, 24 Jan 2023 22:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598476; 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; bh=nJgdk/m2l1znYa5Ny4zMYm8UzS+nEKaeS+XWraGzBmg=; b=kA4pof+sIuHPhUx/gP6UO/o5Lt/ysvxSNc8h2Oha3Sa3SoM2Yiu2vCly8nA0Njuap7YwIs WL+DvFwGjRBem3Gt+mueoM3dnjztu9fRRgeccSwiMBq/teAiG+AxaceOKHF8tCkg1M4eJw bq7go3hC3hECeD+AAdmrkNUGHk5vEq8UND/PLwIKzAGgydizisjkQIrgIxgJvcW+lvCYfl g1hY8/GRylJBEO3YFUT46j3o6ThLZaXo8RHyd9Qgn1SG+xiNhTspZHbMkdIbgG181LW+S5 FthzVbOyNJV4j8PTsufAQGJOMOW1Y8vNqLYgvsH9swuGfvcxgl7H0cVBU87v+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598476; 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; bh=nJgdk/m2l1znYa5Ny4zMYm8UzS+nEKaeS+XWraGzBmg=; b=l/lhAjgYUUGj52bp23FYmxQdTaOfnWdZqG8pbpK/uK/Us4NiLqpnG3vix0s/prdpkGlq5z fobjz5fFHIOxmhC0ckZdtIZ6wLGauWv+Tpy7DJzU7d+aekujJu7SyE1+py8MoN5sv0HaTJ mZW3bivU5nKGBRVoN8iuXbAOEBOHn+FTP4f/E9lYj9CwbLiCKn1Pq8gXknbi5gR1GAYwy4 aeK2kDwtRZZsDXHnruQJBdWsk9GhdXuQskCsUZnsMCvcEBNf730nPe/IT6YmDjHO2WYnwx FMcTFTP8UJ53X2WYL94XEKFR2INJmq7zXALAN1V1/+Lu2CZhThSIXKGM3CDICg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598476; a=rsa-sha256; cv=none; b=cZErkP/x6+8AlOVeqhpdIEa/uHqYyGP/esmm8WvQPZ2b9Ylzr3ebn6NegqtF0JicP8KGR0 rhh5U/ySY3ZHVyeLfy4ouLxVXocLHV9SqrG6bOfnMdEpijPHgS6cLNw+39G+Iig77QGaW+ aQ3xye1m31wghmDHiU40amgJ0L0ad8kz1P4f7wvZUqEt2i3aViJY7bGVNUWhvoW/ulOat3 ondE/UCminEcV1p5DZ217gt42jGLBzTKiJXooT5knZ5YB4SY5fpBarRWJ/CqZkE8VCCAXl t4nDEh1LTj9pVZUehEq/TzVt5RSKAoQ3e7Hti9NiLtEcmNcfx6k/rFbd07bqww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4P1h8r2TCvzQhS; Tue, 24 Jan 2023 22:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OMEaw9090051; Tue, 24 Jan 2023 22:14:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMEaWW090050; Tue, 24 Jan 2023 22:14:36 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:14:36 GMT Message-Id: <202301242214.30OMEaWW090050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3ececb0f35b9 - stable/13 - stand: dev can't be NULL in default_prasedev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3ececb0f35b91948a1122b4df87fc952d31ade8a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3ececb0f35b91948a1122b4df87fc952d31ade8a commit 3ececb0f35b91948a1122b4df87fc952d31ade8a Author: Warner Losh AuthorDate: 2023-01-13 22:44:23 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:47 +0000 stand: dev can't be NULL in default_prasedev We pass in the address of a variable to store this value always in the only place that calls this function, so there is no need to test for NULL. Sponsored by: Netflix Notied by: tsoome in D38041 (cherry picked from commit 4883f347f6ed9a61f9789a3842077580250ebf44) --- stand/libsa/dev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/libsa/dev.c b/stand/libsa/dev.c index 6d1834c8a14a..e76be6cd0eb0 100644 --- a/stand/libsa/dev.c +++ b/stand/libsa/dev.c @@ -100,10 +100,7 @@ default_parsedev(struct devdesc **dev, const char *devspec, idev->d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; - if (dev != NULL) /* maybe this can be required? */ - *dev = idev; - else - free(idev); + *dev = idev; return (0); fail: free(idev);