aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/dgnc
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2014-07-03 19:12:31 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-09 12:07:30 -0700
commit3098e514686305f03d695a2c5c73ba96ad4cc273 (patch)
tree834d28a00ab37f02fc04d4a6a965fcb9bd989246 /drivers/staging/dgnc
parent5b4af85eedea141026214fb40827a718633c5ccf (diff)
downloadlinux-stericsson-3098e514686305f03d695a2c5c73ba96ad4cc273.tar.gz
staging: dgnc: Fix unsigned value for less than zero
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>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 8081621cc9c0..f7409d909781 100644
--- 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--;