From nobody Sat Apr 09 19:54:12 2022 X-Original-To: dev-commits-src-main@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 A28591A98104; Sat, 9 Apr 2022 19:54:16 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KbQmm3yy7z3sYr; Sat, 9 Apr 2022 19:54:16 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649534056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+iQKY5o2uc/oUH/M/NGd2lnfmLRrvMuCxPeUc9bBgjU=; b=NBeCwr0c3YG9NkYmlAabiS+dnBMPxJOATnkEmJkjbRyShZPW+6U2ZvHlN8SYyQjjME46xa VJ/lf9Ts1sRNnoRTiyU18Mb78uFy2dZBLZGaNG9LZwfeD2ZjR2dAEGSqVOiZWarAa6KyBu dxIe/lAu9JliV7JGhh2ywNQC22LsdhIru7FiC+U4xmPhDYBMX64crS1MAxYTxOvB6+xFEw bDUFew5i9UHNF7sa3+KUibx7JTgTR5AI5bSqNECPtfOcM/3vbnFTJsL3zEvJnMN8b/flOG HuW/80E+qwI4/JyQ8LHtzpkdAdGoKE6H2CKz4fuVUpY2eUTAhCC9nc4DOUw5xQ== Received: from localhost (unknown [IPv6:2a02:a03f:894b:4700:501f:73f9:7346:eb81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: tijl) by smtp.freebsd.org (Postfix) with ESMTPSA id C4856B678; Sat, 9 Apr 2022 19:54:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Sat, 9 Apr 2022 21:54:12 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Kirk McKusick Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 4710aa248bcd - main - Avoid dereferencing a possibly null pointer. Message-ID: <20220409215412.4150f709@FreeBSD.org> In-Reply-To: <202204062126.236LQE8a019212@gitrepo.freebsd.org> References: <202204062126.236LQE8a019212@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649534056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+iQKY5o2uc/oUH/M/NGd2lnfmLRrvMuCxPeUc9bBgjU=; b=xvjlMgxE1Zu0rIy99DZ6hZyV5ZtutEjfKUH1Nw659AUa+DE/M9cSUzc8i9zKjlkFZtxNnz jw6rhKt2rW3q27LOgSVCwR3X4yqU7/nRr2kgjwV/xeF8OQmYLjAaz31KJjgSSk8SJrAyXE QMuX/1wEMgPvFMLUBY+VQHunrK1He1ozincCFcgNzwtijAsNpnily7vR1FRQduiI42BzJt GO3z3db5IJOpsNP03VCs4Yy4roP6w6GKKZIjzHehWfI+KF1/YCCQLhUMDThTGOVXjVHgL1 r6FDMC999BsYRTXCkNMUGVGFJSpwh7AQFghr3o/n2+Vi6rM9L2WCStOChXdmbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649534056; a=rsa-sha256; cv=none; b=d2PhY54C2yJytXQi3hI1oXlQC06aIjItPiK52HGnskXryFKh6q30x6R8x/+1Nz2aj97/8i t6cJi9TG5AD4LsZ0EvPECCXtjvT11ekzDw1txRjPfadn/O6Q/EZqm2sGwRW6WEbtBRpfyK 9zbJ0v6cGKQ7PvPvK2AeY018FiPIQS6OpZzoWZI9rKKZq9yjpFJoyOOgaBzZ0L3xHguYVM w0PyjBaxLT9rB9UK8EpRKMaB+xYfdT+53OEWRXXNRPuqhBWoo9sXs/tPdwoNt+e7tm9OVD 3UpPeB4PShmuj4jDWSUsF8GX8YZ5HqDLLLOzMWDekqffp1pFbW6hzgcQjR0j8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Wed, 6 Apr 2022 21:26:14 GMT Kirk McKusick wrote: > The branch main has been updated by mckusick: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4710aa248bcdd77811540ad5695270254edfff55 > > commit 4710aa248bcdd77811540ad5695270254edfff55 > Author: Kirk McKusick > AuthorDate: 2022-04-06 21:25:11 +0000 > Commit: Kirk McKusick > CommitDate: 2022-04-06 21:25:55 +0000 > > Avoid dereferencing a possibly null pointer. > > Reported by: Coverity > CID: 1475868 > --- > sys/geom/union/g_union.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/sys/geom/union/g_union.c b/sys/geom/union/g_union.c > index 5a4977a5fa57..23f7eaac25a9 100644 > --- a/sys/geom/union/g_union.c > +++ b/sys/geom/union/g_union.c > @@ -1317,31 +1317,31 @@ g_union_destroy(struct gctl_req *req, struct g_geom *gp, bool force) > if (force) { > if (req != NULL) > gctl_msg(req, "Device %s is still in use, " > - "so is being forcibly removed.", pp->name); > + "so is being forcibly removed.", gp->name); > G_UNION_DEBUG(1, "Device %s is still in use, so " > - "is being forcibly removed.", pp->name); > + "is being forcibly removed.", gp->name); > } else { > if (req != NULL) > gctl_msg(req, "Device %s is still open " > - "(r=%d w=%d e=%d).", pp->name, pp->acr, > + "(r=%d w=%d e=%d).", gp->name, pp->acr, > pp->acw, pp->ace); Shouldn't the 3 remaining pp be replaced as well? > G_UNION_DEBUG(1, "Device %s is still open " > - "(r=%d w=%d e=%d).", pp->name, pp->acr, > + "(r=%d w=%d e=%d).", gp->name, pp->acr, > pp->acw, pp->ace); And here too? > return (EBUSY); > } > } else { > if (req != NULL) > - gctl_msg(req, "Device %s removed.", pp->name); > - G_UNION_DEBUG(1, "Device %s removed.", pp->name); > + gctl_msg(req, "Device %s removed.", gp->name); > + G_UNION_DEBUG(1, "Device %s removed.", gp->name); > } > /* Close consumers */ > if ((error = g_access(sc->sc_lowercp, -1, 0, -1)) != 0) > G_UNION_DEBUG(2, "Error %d: device %s could not reset access " > - "to %s.", error, pp->name, sc->sc_lowercp->provider->name); > + "to %s.", error, gp->name, sc->sc_lowercp->provider->name); > if ((error = g_access(sc->sc_uppercp, -1, -1, -1)) != 0) > G_UNION_DEBUG(2, "Error %d: device %s could not reset access " > - "to %s.", error, pp->name, sc->sc_uppercp->provider->name); > + "to %s.", error, gp->name, sc->sc_uppercp->provider->name); > > g_wither_geom(gp, ENXIO); >