summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-12-01 10:38:48 -0600
committerDavid Teigland <teigland@redhat.com>2022-12-01 10:38:48 -0600
commit7552ed9010f823d2ac2b99349c62dce8cd6fd506 (patch)
tree1b85b3b7714ffb07e8baf2be2c7e7931b7b2a2ba
parentf80273a1071532115219ea7c23054e6bbb096039 (diff)
downloadlvm2-7552ed9010f823d2ac2b99349c62dce8cd6fd506.tar.gz
device_id: add null id->name null check
for covscan
-rw-r--r--lib/device/device_id.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index aae875776..4fa02edc7 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -1844,8 +1844,8 @@ static int _match_du_to_dev(struct cmd_context *cmd, struct dev_use *du, struct
idtype_to_str(du->idtype), du->idname, dev_name(dev));
return 1;
- } else if ((id->idtype == DEV_ID_TYPE_SYS_WWID) && !strncmp(id->idname, "t10", 3) &&
- du_t10[0] && !strcmp(id->idname, du_t10)) {
+ } else if ((id->idtype == DEV_ID_TYPE_SYS_WWID) && id->idname &&
+ !strncmp(id->idname, "t10", 3) && du_t10[0] && !strcmp(id->idname, du_t10)) {
/* Compare the shorter form du t10 wwid to the dev t10 wwid. */
du->dev = dev;
dev->id = id;