Skip to content

Commit af00742

Browse files
committed
mpr(4) would fail to initialize the controller in some cases, making the
attached storage devices inaccessible. Obtained from: FreeBSD
1 parent 2169db0 commit af00742

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sys/dev/mpr/mpr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,8 +2794,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle,
27942794
bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16);
27952795
}
27962796
#else
2797+
bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask));
27972798
for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++)
2798-
evtreq->EventMasks[i] = htole32(sc->event_mask[i]);
2799+
evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]);
27992800
#endif
28002801
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
28012802
cm->cm_data = NULL;
@@ -2849,8 +2850,9 @@ mpr_reregister_events(struct mpr_softc *sc)
28492850
bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16);
28502851
}
28512852
#else
2853+
bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask));
28522854
for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++)
2853-
evtreq->EventMasks[i] = htole32(sc->event_mask[i]);
2855+
evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]);
28542856
#endif
28552857
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
28562858
cm->cm_data = NULL;

0 commit comments

Comments
 (0)