hdparm/hdparm-9.43-get_geom.patch
Petr Šabata 3553bfaa70 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/hdparm#63bf783c5a54d03e5c88f466ef40844b3a82f329
2020-10-15 12:22:28 +02:00

14 lines
394 B
Diff

Index: hdparm-9.43/geom.c
===================================================================
--- hdparm-9.43.orig/geom.c
+++ hdparm-9.43/geom.c
@@ -201,7 +201,7 @@ int get_dev_geometry (int fd, __u32 *cyl
__u64 hs = (*heads) * (*sects);
__u64 cyl = (*cyls);
__u64 chs = cyl * hs;
- if (chs < (*nsectors))
+ if (chs < (*nsectors) && hs)
*cyls = (*nsectors) / hs;
}
}