1
0
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:
Petr Rockai 2013-11-17 22:34:56 +01:00
parent 71b6565529
commit a5bb1b48ee

View File

@ -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";
}