diff mbox

[2/8] libmultipath: fix sysfs_get_size bug

Message ID 1421439812-11826-3-git-send-email-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Benjamin Marzinski Jan. 16, 2015, 8:23 p.m. UTC
sysfs_get_size wasn't checking for a negative return value from
sysfs_attr_get_value.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index f42cda8..0e05316 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -158,7 +158,7 @@  sysfs_get_size (struct path *pp, unsigned long long * size)
 		return 1;
 
 	attr[0] = '\0';
-	if (sysfs_attr_get_value(pp->udev, "size", attr, 255) == 0) {
+	if (sysfs_attr_get_value(pp->udev, "size", attr, 255) <= 0) {
 		condlog(3, "%s: No size attribute in sysfs", pp->dev);
 		return 1;
 	}