diff options
-rw-r--r-- | drivers/block/floppy.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index d41d7f018549..3266b4f65daa 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -3497,6 +3497,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
3497 | ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))) | 3497 | ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))) |
3498 | return -EPERM; | 3498 | return -EPERM; |
3499 | 3499 | ||
3500 | if (WARN_ON(size < 0 || size > sizeof(inparam))) | ||
3501 | return -EINVAL; | ||
3502 | |||
3500 | /* copyin */ | 3503 | /* copyin */ |
3501 | CLEARSTRUCT(&inparam); | 3504 | CLEARSTRUCT(&inparam); |
3502 | if (_IOC_DIR(cmd) & _IOC_WRITE) | 3505 | if (_IOC_DIR(cmd) & _IOC_WRITE) |