diff options
author | Karel Zak | 2018-05-29 12:09:56 +0200 |
---|---|---|
committer | Karel Zak | 2018-06-21 13:07:46 +0200 |
commit | 67f2d1e326c61c6ea70c0e14d2371645819517fd (patch) | |
tree | 8c5d5facd9dd13d1364551d618c55d0d2fcdaafe /lib/sysfs.c | |
parent | lib/path: simplify debug message (diff) | |
download | kernel-qcow2-util-linux-67f2d1e326c61c6ea70c0e14d2371645819517fd.tar.gz kernel-qcow2-util-linux-67f2d1e326c61c6ea70c0e14d2371645819517fd.tar.xz kernel-qcow2-util-linux-67f2d1e326c61c6ea70c0e14d2371645819517fd.zip |
lib/sysfs: fix sysfs_blkdev_get_wholedisk()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/sysfs.c')
-rw-r--r-- | lib/sysfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c index 953627715..fcfdc46bb 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -601,7 +601,7 @@ int sysfs_blkdev_get_wholedisk( struct path_cxt *pc, } if (diskdevno) { - *diskdevno = __sysfs_devname_to_devno(ul_path_get_prefix(pc), diskname, NULL); + *diskdevno = __sysfs_devname_to_devno(ul_path_get_prefix(pc), name, NULL); if (!*diskdevno) goto err; } @@ -868,6 +868,8 @@ static dev_t __sysfs_devname_to_devno(const char *prefix, const char *name, cons if (!prefix) prefix = ""; + assert(name); + if (strncmp("/dev/", name, 5) == 0) { /* * Read from /dev |