Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[S390] cio: Make ccw_device_register() static.
[S390] Improve AP bus device removal.
[S390] uaccess error handling.
[S390] cio: css_probe_device() must be called enabled.
[S390] Initialize interval value to 0.
[S390] sys_getcpu compat wrapper.

+40 -29
+1
arch/s390/appldata/appldata_base.c
··· 310 310 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) { 311 311 return -EFAULT; 312 312 } 313 + interval = 0; 313 314 sscanf(buf, "%i", &interval); 314 315 if (interval <= 0) { 315 316 P_ERROR("Timer CPU interval has to be > 0!\n");
+3 -1
arch/s390/kernel/compat_linux.c
··· 757 757 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) 758 758 error = -EFAULT; 759 759 } 760 - copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); 760 + if (copy_to_user(args->__unused, tmp.__unused, 761 + sizeof(tmp.__unused))) 762 + error = -EFAULT; 761 763 } 762 764 return error; 763 765 }
+6 -6
arch/s390/kernel/compat_signal.c
··· 169 169 compat_old_sigset_t mask; 170 170 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 171 171 __get_user(sa_handler, &act->sa_handler) || 172 - __get_user(sa_restorer, &act->sa_restorer)) 172 + __get_user(sa_restorer, &act->sa_restorer) || 173 + __get_user(new_ka.sa.sa_flags, &act->sa_flags) || 174 + __get_user(mask, &act->sa_mask)) 173 175 return -EFAULT; 174 176 new_ka.sa.sa_handler = (__sighandler_t) sa_handler; 175 177 new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer; 176 - __get_user(new_ka.sa.sa_flags, &act->sa_flags); 177 - __get_user(mask, &act->sa_mask); 178 178 siginitset(&new_ka.sa.sa_mask, mask); 179 179 } 180 180 ··· 185 185 sa_restorer = (unsigned long) old_ka.sa.sa_restorer; 186 186 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 187 187 __put_user(sa_handler, &oact->sa_handler) || 188 - __put_user(sa_restorer, &oact->sa_restorer)) 188 + __put_user(sa_restorer, &oact->sa_restorer) || 189 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || 190 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) 189 191 return -EFAULT; 190 - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 191 - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 192 192 } 193 193 194 194 return ret;
+1 -1
arch/s390/kernel/compat_wrapper.S
··· 1664 1664 llgtr %r2,%r2 # unsigned * 1665 1665 llgtr %r3,%r3 # unsigned * 1666 1666 llgtr %r4,%r4 # struct getcpu_cache * 1667 - jg sys_tee 1667 + jg sys_getcpu
+6 -6
arch/s390/kernel/signal.c
··· 80 80 old_sigset_t mask; 81 81 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 82 82 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 83 - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) 83 + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || 84 + __get_user(new_ka.sa.sa_flags, &act->sa_flags) || 85 + __get_user(mask, &act->sa_mask)) 84 86 return -EFAULT; 85 - __get_user(new_ka.sa.sa_flags, &act->sa_flags); 86 - __get_user(mask, &act->sa_mask); 87 87 siginitset(&new_ka.sa.sa_mask, mask); 88 88 } 89 89 ··· 92 92 if (!ret && oact) { 93 93 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 94 94 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 95 - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) 95 + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || 96 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || 97 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) 96 98 return -EFAULT; 97 - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 98 - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 99 99 } 100 100 101 101 return ret;
+13 -7
arch/s390/kernel/traps.c
··· 462 462 local_irq_enable(); 463 463 464 464 if (regs->psw.mask & PSW_MASK_PSTATE) { 465 - get_user(*((__u16 *) opcode), (__u16 __user *) location); 465 + if (get_user(*((__u16 *) opcode), (__u16 __user *) location)) 466 + return; 466 467 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { 467 468 if (current->ptrace & PT_PTRACED) 468 469 force_sig(SIGTRAP, current); ··· 471 470 signal = SIGILL; 472 471 #ifdef CONFIG_MATHEMU 473 472 } else if (opcode[0] == 0xb3) { 474 - get_user(*((__u16 *) (opcode+2)), location+1); 473 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 474 + return; 475 475 signal = math_emu_b3(opcode, regs); 476 476 } else if (opcode[0] == 0xed) { 477 - get_user(*((__u32 *) (opcode+2)), 478 - (__u32 __user *)(location+1)); 477 + if (get_user(*((__u32 *) (opcode+2)), 478 + (__u32 __user *)(location+1))) 479 + return; 479 480 signal = math_emu_ed(opcode, regs); 480 481 } else if (*((__u16 *) opcode) == 0xb299) { 481 - get_user(*((__u16 *) (opcode+2)), location+1); 482 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 483 + return; 482 484 signal = math_emu_srnm(opcode, regs); 483 485 } else if (*((__u16 *) opcode) == 0xb29c) { 484 - get_user(*((__u16 *) (opcode+2)), location+1); 486 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 487 + return; 485 488 signal = math_emu_stfpc(opcode, regs); 486 489 } else if (*((__u16 *) opcode) == 0xb29d) { 487 - get_user(*((__u16 *) (opcode+2)), location+1); 490 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 491 + return; 488 492 signal = math_emu_lfpc(opcode, regs); 489 493 #endif 490 494 } else
+3 -4
drivers/s390/cio/css.c
··· 271 271 /* Reset intparm to zeroes. */ 272 272 sch->schib.pmcw.intparm = 0; 273 273 cio_modify(sch); 274 - 275 - /* Probe if necessary. */ 276 - if (action == UNREGISTER_PROBE) 277 - ret = css_probe_device(sch->schid); 278 274 break; 279 275 case REPROBE: 280 276 device_trigger_reprobe(sch); ··· 279 283 break; 280 284 } 281 285 spin_unlock_irqrestore(&sch->lock, flags); 286 + /* Probe if necessary. */ 287 + if (action == UNREGISTER_PROBE) 288 + ret = css_probe_device(sch->schid); 282 289 283 290 return ret; 284 291 }
+1 -2
drivers/s390/cio/device.c
··· 532 532 533 533 /* this is a simple abstraction for device_register that sets the 534 534 * correct bus type and adds the bus specific files */ 535 - int 536 - ccw_device_register(struct ccw_device *cdev) 535 + static int ccw_device_register(struct ccw_device *cdev) 537 536 { 538 537 struct device *dev = &cdev->dev; 539 538 int ret;
-1
drivers/s390/cio/device.h
··· 78 78 79 79 int ccw_device_cancel_halt_clear(struct ccw_device *); 80 80 81 - int ccw_device_register(struct ccw_device *); 82 81 void ccw_device_do_unreg_rereg(void *); 83 82 void ccw_device_call_sch_unregister(void *); 84 83
+6 -1
drivers/s390/crypto/ap_bus.c
··· 739 739 dev = bus_find_device(&ap_bus_type, NULL, 740 740 (void *)(unsigned long)qid, 741 741 __ap_scan_bus); 742 + rc = ap_query_queue(qid, &queue_depth, &device_type); 743 + if (dev && rc) { 744 + put_device(dev); 745 + device_unregister(dev); 746 + continue; 747 + } 742 748 if (dev) { 743 749 put_device(dev); 744 750 continue; 745 751 } 746 - rc = ap_query_queue(qid, &queue_depth, &device_type); 747 752 if (rc) 748 753 continue; 749 754 rc = ap_init_queue(qid);