diff options
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 7a0c74648124..02d7f046c10a 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/char/pcmcia/synclink_cs.c | 2 | * linux/drivers/char/pcmcia/synclink_cs.c |
3 | * | 3 | * |
4 | * $Id: synclink_cs.c,v 4.26 2004/08/11 19:30:02 paulkf Exp $ | 4 | * $Id: synclink_cs.c,v 4.34 2005/09/08 13:20:54 paulkf Exp $ |
5 | * | 5 | * |
6 | * Device driver for Microgate SyncLink PC Card | 6 | * Device driver for Microgate SyncLink PC Card |
7 | * multiprotocol serial adapter. | 7 | * multiprotocol serial adapter. |
@@ -472,7 +472,7 @@ module_param_array(dosyncppp, int, NULL, 0); | |||
472 | MODULE_LICENSE("GPL"); | 472 | MODULE_LICENSE("GPL"); |
473 | 473 | ||
474 | static char *driver_name = "SyncLink PC Card driver"; | 474 | static char *driver_name = "SyncLink PC Card driver"; |
475 | static char *driver_version = "$Revision: 4.26 $"; | 475 | static char *driver_version = "$Revision: 4.34 $"; |
476 | 476 | ||
477 | static struct tty_driver *serial_driver; | 477 | static struct tty_driver *serial_driver; |
478 | 478 | ||
@@ -1457,6 +1457,8 @@ static int startup(MGSLPC_INFO * info) | |||
1457 | 1457 | ||
1458 | info->pending_bh = 0; | 1458 | info->pending_bh = 0; |
1459 | 1459 | ||
1460 | memset(&info->icount, 0, sizeof(info->icount)); | ||
1461 | |||
1460 | init_timer(&info->tx_timer); | 1462 | init_timer(&info->tx_timer); |
1461 | info->tx_timer.data = (unsigned long)info; | 1463 | info->tx_timer.data = (unsigned long)info; |
1462 | info->tx_timer.function = tx_timeout; | 1464 | info->tx_timer.function = tx_timeout; |
@@ -1946,9 +1948,13 @@ static int get_stats(MGSLPC_INFO * info, struct mgsl_icount __user *user_icount) | |||
1946 | int err; | 1948 | int err; |
1947 | if (debug_level >= DEBUG_LEVEL_INFO) | 1949 | if (debug_level >= DEBUG_LEVEL_INFO) |
1948 | printk("get_params(%s)\n", info->device_name); | 1950 | printk("get_params(%s)\n", info->device_name); |
1949 | COPY_TO_USER(err,user_icount, &info->icount, sizeof(struct mgsl_icount)); | 1951 | if (!user_icount) { |
1950 | if (err) | 1952 | memset(&info->icount, 0, sizeof(info->icount)); |
1951 | return -EFAULT; | 1953 | } else { |
1954 | COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount)); | ||
1955 | if (err) | ||
1956 | return -EFAULT; | ||
1957 | } | ||
1952 | return 0; | 1958 | return 0; |
1953 | } | 1959 | } |
1954 | 1960 | ||