Skip to content

Commit 12a4bb1

Browse files
authored
[kernel] fix device_open oflag comparison error. (#7512)
1 parent de567b8 commit 12a4bb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
235235

236236
/* device is not opened or opened by other oflag, call device_open interface */
237237
if (!(dev->open_flag & RT_DEVICE_OFLAG_OPEN) ||
238-
((dev->open_flag & RT_DEVICE_OFLAG_MASK) | (oflag & RT_DEVICE_OFLAG_MASK)))
238+
((dev->open_flag & RT_DEVICE_OFLAG_MASK) != (oflag & RT_DEVICE_OFLAG_MASK)))
239239
{
240240
if (device_open != RT_NULL)
241241
{

0 commit comments

Comments
 (0)