Skip to content

Commit

Permalink
Char: mxser, ratelimit ioctl warning
Browse files Browse the repository at this point in the history
The GET_MAJOR ioctl prints out a warning, make it ratelimited.

Signed-off-by: Jiri Slaby <[email protected]>
Acked-by: Alan Cox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jirislaby authored and torvalds committed Jul 30, 2008
1 parent bd673c7 commit 8f3d137
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/char/mxser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,10 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp)

switch (cmd) {
case MOXA_GET_MAJOR:
printk(KERN_WARNING "mxser: '%s' uses deprecated ioctl %x, fix "
"your userspace\n", current->comm, cmd);
if (printk_ratelimit())
printk(KERN_WARNING "mxser: '%s' uses deprecated ioctl "
"%x (GET_MAJOR), fix your userspace\n",
current->comm, cmd);
return put_user(ttymajor, (int __user *)argp);

case MOXA_CHKPORTENABLE:
Expand Down

0 comments on commit 8f3d137

Please sign in to comment.