diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 6 | ||||
-rw-r--r-- | drivers/char/mwave/mwavepub.h | 2 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 13 | ||||
-rw-r--r-- | drivers/char/watchdog/booke_wdt.c | 13 | ||||
-rw-r--r-- | drivers/char/watchdog/wdrtas.c | 2 |
5 files changed, 20 insertions, 16 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 01a1f6badb53..beea450ee4b2 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2399,7 +2399,8 @@ static int init_one_smi(int intf_num, struct smi_info **smi) | |||
2399 | new_smi->handlers->cleanup(new_smi->si_sm); | 2399 | new_smi->handlers->cleanup(new_smi->si_sm); |
2400 | kfree(new_smi->si_sm); | 2400 | kfree(new_smi->si_sm); |
2401 | } | 2401 | } |
2402 | new_smi->io_cleanup(new_smi); | 2402 | if (new_smi->io_cleanup) |
2403 | new_smi->io_cleanup(new_smi); | ||
2403 | 2404 | ||
2404 | return rv; | 2405 | return rv; |
2405 | } | 2406 | } |
@@ -2518,7 +2519,8 @@ static void __exit cleanup_one_si(struct smi_info *to_clean) | |||
2518 | 2519 | ||
2519 | kfree(to_clean->si_sm); | 2520 | kfree(to_clean->si_sm); |
2520 | 2521 | ||
2521 | to_clean->io_cleanup(to_clean); | 2522 | if (to_clean->io_cleanup) |
2523 | to_clean->io_cleanup(to_clean); | ||
2522 | } | 2524 | } |
2523 | 2525 | ||
2524 | static __exit void cleanup_ipmi_si(void) | 2526 | static __exit void cleanup_ipmi_si(void) |
diff --git a/drivers/char/mwave/mwavepub.h b/drivers/char/mwave/mwavepub.h index f1f9da7a65c1..60c961ae23b4 100644 --- a/drivers/char/mwave/mwavepub.h +++ b/drivers/char/mwave/mwavepub.h | |||
@@ -69,7 +69,7 @@ typedef struct _MW_ABILITIES { | |||
69 | typedef struct _MW_READWRITE { | 69 | typedef struct _MW_READWRITE { |
70 | unsigned short usDspAddress; /* The dsp address */ | 70 | unsigned short usDspAddress; /* The dsp address */ |
71 | unsigned long ulDataLength; /* The size in bytes of the data or user buffer */ | 71 | unsigned long ulDataLength; /* The size in bytes of the data or user buffer */ |
72 | void *pBuf; /* Input:variable sized buffer */ | 72 | void __user *pBuf; /* Input:variable sized buffer */ |
73 | } MW_READWRITE, *pMW_READWRITE; | 73 | } MW_READWRITE, *pMW_READWRITE; |
74 | 74 | ||
75 | #define IOCTL_MW_RESET _IO(MWAVE_MINOR,1) | 75 | #define IOCTL_MW_RESET _IO(MWAVE_MINOR,1) |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index ef011ef5dc46..61681c9f3f72 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -1444,6 +1444,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1444 | dev_link_t *link; | 1444 | dev_link_t *link; |
1445 | int size; | 1445 | int size; |
1446 | int rc; | 1446 | int rc; |
1447 | void __user *argp = (void __user *)arg; | ||
1447 | #ifdef PCMCIA_DEBUG | 1448 | #ifdef PCMCIA_DEBUG |
1448 | char *ioctl_names[CM_IOC_MAXNR + 1] = { | 1449 | char *ioctl_names[CM_IOC_MAXNR + 1] = { |
1449 | [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS", | 1450 | [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS", |
@@ -1481,11 +1482,11 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1481 | _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd); | 1482 | _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd); |
1482 | 1483 | ||
1483 | if (_IOC_DIR(cmd) & _IOC_READ) { | 1484 | if (_IOC_DIR(cmd) & _IOC_READ) { |
1484 | if (!access_ok(VERIFY_WRITE, (void *)arg, size)) | 1485 | if (!access_ok(VERIFY_WRITE, argp, size)) |
1485 | return -EFAULT; | 1486 | return -EFAULT; |
1486 | } | 1487 | } |
1487 | if (_IOC_DIR(cmd) & _IOC_WRITE) { | 1488 | if (_IOC_DIR(cmd) & _IOC_WRITE) { |
1488 | if (!access_ok(VERIFY_READ, (void *)arg, size)) | 1489 | if (!access_ok(VERIFY_READ, argp, size)) |
1489 | return -EFAULT; | 1490 | return -EFAULT; |
1490 | } | 1491 | } |
1491 | 1492 | ||
@@ -1506,14 +1507,14 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1506 | status |= CM_NO_READER; | 1507 | status |= CM_NO_READER; |
1507 | if (test_bit(IS_BAD_CARD, &dev->flags)) | 1508 | if (test_bit(IS_BAD_CARD, &dev->flags)) |
1508 | status |= CM_BAD_CARD; | 1509 | status |= CM_BAD_CARD; |
1509 | if (copy_to_user((int *)arg, &status, sizeof(int))) | 1510 | if (copy_to_user(argp, &status, sizeof(int))) |
1510 | return -EFAULT; | 1511 | return -EFAULT; |
1511 | } | 1512 | } |
1512 | return 0; | 1513 | return 0; |
1513 | case CM_IOCGATR: | 1514 | case CM_IOCGATR: |
1514 | DEBUGP(4, dev, "... in CM_IOCGATR\n"); | 1515 | DEBUGP(4, dev, "... in CM_IOCGATR\n"); |
1515 | { | 1516 | { |
1516 | struct atreq *atreq = (struct atreq *) arg; | 1517 | struct atreq __user *atreq = argp; |
1517 | int tmp; | 1518 | int tmp; |
1518 | /* allow nonblocking io and being interrupted */ | 1519 | /* allow nonblocking io and being interrupted */ |
1519 | if (wait_event_interruptible | 1520 | if (wait_event_interruptible |
@@ -1597,7 +1598,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1597 | { | 1598 | { |
1598 | struct ptsreq krnptsreq; | 1599 | struct ptsreq krnptsreq; |
1599 | 1600 | ||
1600 | if (copy_from_user(&krnptsreq, (struct ptsreq *) arg, | 1601 | if (copy_from_user(&krnptsreq, argp, |
1601 | sizeof(struct ptsreq))) | 1602 | sizeof(struct ptsreq))) |
1602 | return -EFAULT; | 1603 | return -EFAULT; |
1603 | 1604 | ||
@@ -1641,7 +1642,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1641 | int old_pc_debug = 0; | 1642 | int old_pc_debug = 0; |
1642 | 1643 | ||
1643 | old_pc_debug = pc_debug; | 1644 | old_pc_debug = pc_debug; |
1644 | if (copy_from_user(&pc_debug, (int *)arg, sizeof(int))) | 1645 | if (copy_from_user(&pc_debug, argp, sizeof(int))) |
1645 | return -EFAULT; | 1646 | return -EFAULT; |
1646 | 1647 | ||
1647 | if (old_pc_debug != pc_debug) | 1648 | if (old_pc_debug != pc_debug) |
diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c index 65830ec71042..c800cce73c1e 100644 --- a/drivers/char/watchdog/booke_wdt.c +++ b/drivers/char/watchdog/booke_wdt.c | |||
@@ -72,7 +72,7 @@ static __inline__ void booke_wdt_ping(void) | |||
72 | /* | 72 | /* |
73 | * booke_wdt_write: | 73 | * booke_wdt_write: |
74 | */ | 74 | */ |
75 | static ssize_t booke_wdt_write (struct file *file, const char *buf, | 75 | static ssize_t booke_wdt_write (struct file *file, const char __user *buf, |
76 | size_t count, loff_t *ppos) | 76 | size_t count, loff_t *ppos) |
77 | { | 77 | { |
78 | booke_wdt_ping(); | 78 | booke_wdt_ping(); |
@@ -92,14 +92,15 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file, | |||
92 | unsigned int cmd, unsigned long arg) | 92 | unsigned int cmd, unsigned long arg) |
93 | { | 93 | { |
94 | u32 tmp = 0; | 94 | u32 tmp = 0; |
95 | u32 __user *p = (u32 __user *)arg; | ||
95 | 96 | ||
96 | switch (cmd) { | 97 | switch (cmd) { |
97 | case WDIOC_GETSUPPORT: | 98 | case WDIOC_GETSUPPORT: |
98 | if (copy_to_user ((struct watchdog_info *) arg, &ident, | 99 | if (copy_to_user ((struct watchdog_info __user *) arg, &ident, |
99 | sizeof(struct watchdog_info))) | 100 | sizeof(struct watchdog_info))) |
100 | return -EFAULT; | 101 | return -EFAULT; |
101 | case WDIOC_GETSTATUS: | 102 | case WDIOC_GETSTATUS: |
102 | return put_user(ident.options, (u32 *) arg); | 103 | return put_user(ident.options, p); |
103 | case WDIOC_GETBOOTSTATUS: | 104 | case WDIOC_GETBOOTSTATUS: |
104 | /* XXX: something is clearing TSR */ | 105 | /* XXX: something is clearing TSR */ |
105 | tmp = mfspr(SPRN_TSR) & TSR_WRS(3); | 106 | tmp = mfspr(SPRN_TSR) & TSR_WRS(3); |
@@ -109,14 +110,14 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file, | |||
109 | booke_wdt_ping(); | 110 | booke_wdt_ping(); |
110 | return 0; | 111 | return 0; |
111 | case WDIOC_SETTIMEOUT: | 112 | case WDIOC_SETTIMEOUT: |
112 | if (get_user(booke_wdt_period, (u32 *) arg)) | 113 | if (get_user(booke_wdt_period, p)) |
113 | return -EFAULT; | 114 | return -EFAULT; |
114 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period)); | 115 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period)); |
115 | return 0; | 116 | return 0; |
116 | case WDIOC_GETTIMEOUT: | 117 | case WDIOC_GETTIMEOUT: |
117 | return put_user(booke_wdt_period, (u32 *) arg); | 118 | return put_user(booke_wdt_period, p); |
118 | case WDIOC_SETOPTIONS: | 119 | case WDIOC_SETOPTIONS: |
119 | if (get_user(tmp, (u32 *) arg)) | 120 | if (get_user(tmp, p)) |
120 | return -EINVAL; | 121 | return -EINVAL; |
121 | if (tmp == WDIOS_ENABLECARD) { | 122 | if (tmp == WDIOS_ENABLECARD) { |
122 | booke_wdt_ping(); | 123 | booke_wdt_ping(); |
diff --git a/drivers/char/watchdog/wdrtas.c b/drivers/char/watchdog/wdrtas.c index 619e2ffca33f..dacfe31caccf 100644 --- a/drivers/char/watchdog/wdrtas.c +++ b/drivers/char/watchdog/wdrtas.c | |||
@@ -320,7 +320,7 @@ static int | |||
320 | wdrtas_ioctl(struct inode *inode, struct file *file, | 320 | wdrtas_ioctl(struct inode *inode, struct file *file, |
321 | unsigned int cmd, unsigned long arg) | 321 | unsigned int cmd, unsigned long arg) |
322 | { | 322 | { |
323 | int __user *argp = (void *)arg; | 323 | int __user *argp = (void __user *)arg; |
324 | int i; | 324 | int i; |
325 | static struct watchdog_info wdinfo = { | 325 | static struct watchdog_info wdinfo = { |
326 | .options = WDRTAS_SUPPORTED_MASK, | 326 | .options = WDRTAS_SUPPORTED_MASK, |