Correct logic error in biosdisk.c:bd_realstrategy()

The wrong condition is used when evaluating the return of disk_ioctl()
This results in reaching the 'We should not get here' branch in most casts

Reviewed by:	imp
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15839
This commit is contained in:
Allan Jude 2018-06-16 02:50:29 +00:00
parent 4e3db1e0af
commit 86981e426d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335245

View File

@ -594,8 +594,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
*rsize = 0;
/* Get disk blocks, this value is either for whole disk or for partition */
if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks)) {
/* DIOCGMEDIASIZE does return bytes. */
if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) {
/* DIOCGMEDIASIZE returns bytes. */
disk_blocks /= BD(dev).bd_sectorsize;
} else {
/* We should not get here. Just try to survive. */