Date: Sat, 16 Jun 2018 02:50:29 +0000 (UTC) From: Allan Jude <allanjude@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335245 - head/stand/i386/libi386 Message-ID: <201806160250.w5G2oT5Y033519@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: allanjude Date: Sat Jun 16 02:50:29 2018 New Revision: 335245 URL: https://svnweb.freebsd.org/changeset/base/335245 Log: 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 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jun 16 00:35:19 2018 (r335244) +++ head/stand/i386/libi386/biosdisk.c Sat Jun 16 02:50:29 2018 (r335245) @@ -594,8 +594,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s *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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806160250.w5G2oT5Y033519>