Skip to content

Commit b419632

Browse files
committed
MT#55283 fix stream close race condition
Using the stream object after dropping the reference is unsafe. Change-Id: I58df474272cc7e168d6d65e5f6ace3a42fe22ef1 (cherry picked from commit 9a3f33a) (cherry picked from commit 4e8b3c8)
1 parent b84f9ee commit b419632

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

kernel-module/xt_RTPENGINE.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,12 +1087,12 @@ static void stream_put(struct re_stream *stream) {
10871087
if (!stream)
10881088
return;
10891089

1090-
if (!atomic_dec_and_test(&stream->refcnt)) {
1091-
/* if this is an open file being closed and there's a del_stream()
1092-
* waiting for us, we need to wake up the sleeping del_stream() */
1093-
wake_up_interruptible(&stream->close_wq);
1090+
/* if this is an open file being closed and there's a del_stream()
1091+
* waiting for us, we need to wake up the sleeping del_stream() */
1092+
wake_up_interruptible(&stream->close_wq);
1093+
1094+
if (!atomic_dec_and_test(&stream->refcnt))
10941095
return;
1095-
}
10961096

10971097
DBG("Freeing stream object\n");
10981098

0 commit comments

Comments
 (0)