mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-11-16 12:34:33 +00:00
fix(ioctl): _IOR() overflows in switch (int) #10650
This commit is contained in:
@@ -190,7 +190,7 @@ static int pipe_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
|
||||
|
||||
pipe = (rt_pipe_t *)fd->vnode->data;
|
||||
|
||||
switch (cmd)
|
||||
switch ((rt_ubase_t)cmd)
|
||||
{
|
||||
case FIONREAD:
|
||||
*((int*)args) = rt_ringbuffer_data_len(pipe->fifo);
|
||||
|
||||
@@ -125,7 +125,7 @@ static int serial_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
|
||||
int mask = O_NONBLOCK | O_APPEND;
|
||||
|
||||
device = (rt_device_t)fd->vnode->data;
|
||||
switch (cmd)
|
||||
switch ((rt_ubase_t)cmd)
|
||||
{
|
||||
case FIONREAD:
|
||||
break;
|
||||
@@ -1074,7 +1074,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
|
||||
RT_ASSERT(dev != RT_NULL);
|
||||
serial = (struct rt_serial_device *)dev;
|
||||
|
||||
switch (cmd)
|
||||
switch ((rt_ubase_t)cmd)
|
||||
{
|
||||
case RT_DEVICE_CTRL_SUSPEND:
|
||||
/* suspend device */
|
||||
|
||||
@@ -121,7 +121,7 @@ static int serial_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
|
||||
int mask = O_NONBLOCK | O_APPEND;
|
||||
|
||||
device = (rt_device_t)fd->vnode->data;
|
||||
switch (cmd)
|
||||
switch ((rt_ubase_t)cmd)
|
||||
{
|
||||
case FIONREAD:
|
||||
break;
|
||||
@@ -1385,7 +1385,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
|
||||
RT_ASSERT(dev != RT_NULL);
|
||||
serial = (struct rt_serial_device *)dev;
|
||||
|
||||
switch (cmd)
|
||||
switch ((rt_ubase_t)cmd)
|
||||
{
|
||||
case RT_DEVICE_CTRL_SUSPEND:
|
||||
/* suspend device */
|
||||
|
||||
Reference in New Issue
Block a user