Skip to content

Commit 3b85299

Browse files
authored
Merge pull request #4 from rota1001/fix-producer-stopping-condition
Fix incorrect open count check in release function
2 parents 9043d41 + e16269e commit 3b85299

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int simrupt_open(struct inode *inode, struct file *filp)
298298
static int simrupt_release(struct inode *inode, struct file *filp)
299299
{
300300
pr_debug("simrupt: %s\n", __func__);
301-
if (atomic_dec_and_test(&open_cnt) == 0) {
301+
if (atomic_dec_and_test(&open_cnt)) {
302302
del_timer_sync(&timer);
303303
flush_workqueue(simrupt_workqueue);
304304
fast_buf_clear();

0 commit comments

Comments
 (0)