Author: markj Date: Thu Aug 27 16:34:33 2020 New Revision: 364872 URL: https://svnweb.freebsd.org/changeset/base/364872
Log: fdc(4): Handle errors from fdc_in() properly. fdc_in() returns only 0 and 1, some callers were checking incorrectly for failure. PR: 248940 Submitted by: Tong Zhang <ztong0...@gmail.com> MFC after: 1 week Modified: head/sys/dev/fdc/fdc.c Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Thu Aug 27 16:34:20 2020 (r364871) +++ head/sys/dev/fdc/fdc.c Thu Aug 27 16:34:33 2020 (r364872) @@ -492,7 +492,7 @@ fdc_cmd(struct fdc_data *fdc, int n_out, ...) n_in = va_arg(ap, int); for (n = 0; n < n_in; n++) { int *ptr = va_arg(ap, int *); - if (fdc_in(fdc, ptr) < 0) { + if (fdc_in(fdc, ptr) != 0) { char msg[50]; snprintf(msg, sizeof(msg), "cmd %02x failed at in byte %d of %d\n", @@ -587,7 +587,7 @@ fdc_sense_int(struct fdc_data *fdc, int *st0p, int *cy return (FD_NOT_VALID); } - if (fdc_in(fdc, &cyl) < 0) + if (fdc_in(fdc, &cyl) != 0) return fdc_err(fdc, "can't get cyl num\n"); if (cylp) _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"