diff options
author | Warner Losh <imp@FreeBSD.org> | 2021-11-05 14:56:27 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2021-11-05 14:56:27 +0000 |
commit | 710a519ebbe34850ee37e688896a761606be5009 (patch) | |
tree | 9eee115af5c64e4fdb9a35887d6fbb3f8490e0d5 | |
parent | bee0133fb937e519623324fd1ae7214d59a03aca (diff) | |
download | src-710a519ebbe34850ee37e688896a761606be5009.tar.gz src-710a519ebbe34850ee37e688896a761606be5009.zip |
cam_periph: fix bug in camperiphunitnext logic
If we assigned just a lun as a wired unit (something that camperiphunit
will accept), we failed to properly skip over that unit when computing a
next unit number. Add lun so the code matches the comments that we have
to skip all the same criteria that camperiphunit uses to select wired
units for a driver.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32682
-rw-r--r-- | sys/cam/cam_periph.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 37a54a2d992b..8fbc2e3926fa 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -582,7 +582,8 @@ camperiphnextunit(struct periph_driver *p_drv, u_int newunit, int wired, if (newunit != dunit) continue; - if (resource_int_value(dname, dunit, "target", &val) == 0 || + if (resource_int_value(dname, dunit, "lun", &val) == 0 || + resource_int_value(dname, dunit, "target", &val) == 0 || resource_string_value(dname, dunit, "at", &strval) == 0) break; } |