diff options
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/hardware/eicon/divasmain.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/divasproc.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hycapi.c | 6 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_procconf.c | 29 | ||||
-rw-r--r-- | drivers/isdn/sc/ioctl.c | 1 |
5 files changed, 14 insertions, 27 deletions
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c index 5fcbdccd7a53..16a874bb1561 100644 --- a/drivers/isdn/hardware/eicon/divasmain.c +++ b/drivers/isdn/hardware/eicon/divasmain.c | |||
@@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void) | |||
806 | 806 | ||
807 | if (!create_divas_proc()) { | 807 | if (!create_divas_proc()) { |
808 | #ifdef MODULE | 808 | #ifdef MODULE |
809 | remove_divas_proc(); | ||
810 | divas_unregister_chrdev(); | 809 | divas_unregister_chrdev(); |
811 | divasfunc_exit(); | 810 | divasfunc_exit(); |
812 | #endif | 811 | #endif |
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c index fae895828a17..040827288ec9 100644 --- a/drivers/isdn/hardware/eicon/divasproc.c +++ b/drivers/isdn/hardware/eicon/divasproc.c | |||
@@ -125,8 +125,8 @@ static const struct file_operations divas_fops = { | |||
125 | 125 | ||
126 | int create_divas_proc(void) | 126 | int create_divas_proc(void) |
127 | { | 127 | { |
128 | proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon, | 128 | divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO, |
129 | &divas_fops); | 129 | proc_net_eicon, &divas_fops); |
130 | if (!divas_proc_entry) | 130 | if (!divas_proc_entry) |
131 | return (0); | 131 | return (0); |
132 | 132 | ||
diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index d3999a8e9f88..53f6ad1235db 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c | |||
@@ -462,11 +462,11 @@ static int hycapi_read_proc(char *page, char **start, off_t off, | |||
462 | default: s = "???"; break; | 462 | default: s = "???"; break; |
463 | } | 463 | } |
464 | len += sprintf(page+len, "%-16s %s\n", "type", s); | 464 | len += sprintf(page+len, "%-16s %s\n", "type", s); |
465 | if ((s = cinfo->version[VER_DRIVER]) != 0) | 465 | if ((s = cinfo->version[VER_DRIVER]) != NULL) |
466 | len += sprintf(page+len, "%-16s %s\n", "ver_driver", s); | 466 | len += sprintf(page+len, "%-16s %s\n", "ver_driver", s); |
467 | if ((s = cinfo->version[VER_CARDTYPE]) != 0) | 467 | if ((s = cinfo->version[VER_CARDTYPE]) != NULL) |
468 | len += sprintf(page+len, "%-16s %s\n", "ver_cardtype", s); | 468 | len += sprintf(page+len, "%-16s %s\n", "ver_cardtype", s); |
469 | if ((s = cinfo->version[VER_SERIAL]) != 0) | 469 | if ((s = cinfo->version[VER_SERIAL]) != NULL) |
470 | len += sprintf(page+len, "%-16s %s\n", "ver_serial", s); | 470 | len += sprintf(page+len, "%-16s %s\n", "ver_serial", s); |
471 | 471 | ||
472 | len += sprintf(page+len, "%-16s %s\n", "cardname", cinfo->cardname); | 472 | len += sprintf(page+len, "%-16s %s\n", "cardname", cinfo->cardname); |
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index 15906d005b05..484299b031f8 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c | |||
@@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t | |||
207 | /* read conf file -> output card info data */ | 207 | /* read conf file -> output card info data */ |
208 | /*******************************************/ | 208 | /*******************************************/ |
209 | static ssize_t | 209 | static ssize_t |
210 | hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off) | 210 | hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off) |
211 | { | 211 | { |
212 | char *cp; | 212 | char *cp; |
213 | int i; | ||
214 | 213 | ||
215 | if (file->f_mode & FMODE_READ) { | 214 | if (!(file->f_mode & FMODE_READ)) |
216 | if (!(cp = file->private_data)) | 215 | return -EPERM; /* no permission to read */ |
217 | return (-EFAULT); /* should never happen */ | 216 | |
218 | i = strlen(cp); /* get total string length */ | 217 | if (!(cp = file->private_data)) |
219 | if (*off < i) { | 218 | return -EFAULT; /* should never happen */ |
220 | /* still bytes to transfer */ | 219 | |
221 | cp += *off; /* point to desired data offset */ | 220 | return simple_read_from_buffer(buf, count, off, cp, strlen(cp)); |
222 | i -= *off; /* remaining length */ | ||
223 | if (i > count) | ||
224 | i = count; /* limit length to transfer */ | ||
225 | if (copy_to_user(buf, cp, i)) | ||
226 | return (-EFAULT); /* copy error */ | ||
227 | *off += i; /* adjust offset */ | ||
228 | } else | ||
229 | return (0); | ||
230 | } else | ||
231 | return (-EPERM); /* no permission to read */ | ||
232 | |||
233 | return (i); | ||
234 | } /* hysdn_conf_read */ | 221 | } /* hysdn_conf_read */ |
235 | 222 | ||
236 | /******************/ | 223 | /******************/ |
diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c index 7817d2244921..1081091bbfaf 100644 --- a/drivers/isdn/sc/ioctl.c +++ b/drivers/isdn/sc/ioctl.c | |||
@@ -226,6 +226,7 @@ int sc_ioctl(int card, scs_ioctl *data) | |||
226 | */ | 226 | */ |
227 | if (copy_from_user(spid, data->dataptr, SCIOC_SPIDSIZE)) { | 227 | if (copy_from_user(spid, data->dataptr, SCIOC_SPIDSIZE)) { |
228 | kfree(rcvmsg); | 228 | kfree(rcvmsg); |
229 | kfree(spid); | ||
229 | return -EFAULT; | 230 | return -EFAULT; |
230 | } | 231 | } |
231 | 232 | ||