Mon Mar 9 15:40:50 2020 UTC ()
external/cddl/osnet: Fix possible null pointer access.

Detected by UBSan and fixed upstream, pick only the fix from the commit.

Cherry-pick:
From 928e8ad47d3478a3d5d01f0dd6ae74a9371af65e Mon Sep 17 00:00:00 2001
From: Serapheim Dimitropoulos <serapheimd@gmail.com>
Date: Wed, 20 Feb 2019 09:59:57 -0800
Subject: [PATCH] Introduce auxiliary metaslab histograms

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #8358

Reviewed by: kamil@


(fox)
diff -r1.1.1.3 -r1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c

cvs diff -r1.1.1.3 -r1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c (expand / switch to context diff)
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c 2018/05/28 20:52:58 1.1.1.3
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c 2020/03/09 15:40:50 1.2
@@ -3370,7 +3370,7 @@
     zio_alloc_list_t *zal, zio_t *zio)
 {
 	dva_t *dva = bp->blk_dva;
-	dva_t *hintdva = hintbp->blk_dva;
+	dva_t *hintdva = (hintbp != NULL) ? hintbp->blk_dva : NULL;
 	int error = 0;
 
 	ASSERT(bp->blk_birth == 0);