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:
Gregory Nutt 2015-02-23 20:14:39 -06:00
parent f4a2ebc220
commit 4320b1b1a3

View File

@ -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);