From: Vitaliy Makkoveev Subject: Re: sys/ihidev: prevent crash on interrupt storm To: "Kirill A. Korinsky" Cc: Martin Pieuchot , OpenBSD tech Date: Wed, 25 Dec 2024 02:44:19 +0300 > On 25 Dec 2024, at 01:26, Vitaliy Makkoveev wrote: > > At least you should check err in the for loop, otherwise it could > be overwritten with the EWOULDBLOCK even in the non error case. Also > sc_st check and sleep should be serialised with sc_st modification > within interrupt handler, otherwise the wakeup could be lost. Sorry, missed this. > + for (i = 0, err = 0; i < 10 && err == 0; i++) {