mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
CAN driver: Another Ooops... Cannot save the updated driver open count if the we fail to initialize the CAN driver, causing the open to fail
This commit is contained in:
+9
-3
@@ -185,14 +185,20 @@ static int can_open(FAR struct file *filep)
|
||||
/* Finally, Enable the CAN RX interrupt */
|
||||
|
||||
dev_rxint(dev, true);
|
||||
|
||||
/* Save the new open count on success */
|
||||
|
||||
dev->cd_ocount = 1;
|
||||
}
|
||||
|
||||
irqrestore(flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Save the incremented open count on success */
|
||||
|
||||
/* Save the new open count on success */
|
||||
|
||||
dev->cd_ocount = tmp;
|
||||
dev->cd_ocount = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
sem_post(&dev->cd_closesem);
|
||||
|
||||
Reference in New Issue
Block a user