mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dev-cache.c: Make dev_name a little more robust.
This commit is contained in:
parent
71b6565529
commit
a5bb1b48ee
@ -1036,6 +1036,6 @@ int dev_fd(struct device *dev)
|
||||
|
||||
const char *dev_name(const struct device *dev)
|
||||
{
|
||||
return (dev) ? dm_list_item(dev->aliases.n, struct str_list)->str :
|
||||
return (dev && dev->aliases.n) ? dm_list_item(dev->aliases.n, struct str_list)->str :
|
||||
"unknown device";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user