projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b4af85
)
staging: dgnc: Fix unsigned value for less than zero
author
Daeseok Youn
<daeseok.youn@gmail.com>
Thu, 3 Jul 2014 10:12:31 +0000
(19:12 +0900)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 19:07:30 +0000
(12:07 -0700)
The "un->un_open_count" is unsigned variable, so it cannot
be less than zero.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c
patch
|
blob
|
history
diff --git
a/drivers/staging/dgnc/dgnc_tty.c
b/drivers/staging/dgnc/dgnc_tty.c
index 8081621cc9c0c4b2166e0e4ad452d2d4a54a91d1..f7409d90978119fbc1cd961a1ecc4ecf42d14377 100644
(file)
--- a/
drivers/staging/dgnc/dgnc_tty.c
+++ b/
drivers/staging/dgnc/dgnc_tty.c
@@
-1636,10
+1636,10
@@
static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
un->un_open_count = 1;
}
- if (--un->un_open_count < 0) {
+ if (un->un_open_count)
+ un->un_open_count--;
+ else
APR(("bad serial port open count of %d\n", un->un_open_count));
- un->un_open_count = 0;
- }
ch->ch_open_count--;