linux-stable-rt/drivers/char
Julia Lawall 9b71ca2005 drivers/char/vt.c: use memdup_user
Use memdup_user when user data is immediately copied into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   <+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+>
   }
-  if (copy_from_user(to, from, size) != 0) {
-    <+... when != goto l2;
-    -EFAULT
-    ...+>
-  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:40 -07:00
..
agp Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-05-26 12:30:09 -07:00
hw_random Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-05-25 12:06:33 -07:00
ip2
ipmi Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing 2010-05-24 08:01:10 -07:00
mwave
pcmcia pcmcia: dev_node removal (remaining drivers) 2010-05-10 10:23:16 +02:00
rio
tpm TPM: ACPI/PNP dependency removal 2010-05-17 09:08:18 +10:00
xilinx_hwicap of: Remove duplicate fields from of_platform_driver 2010-05-22 00:10:40 -06:00
.gitignore
Kconfig tty: n_gsm: depends on NET 2010-05-21 09:34:29 -07:00
Makefile tty: n_gsm line discipline 2010-05-21 09:34:29 -07:00
amiserial.c
apm-emulation.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
applicom.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
applicom.h
bfin-otp.c
bfin_jtag_comm.c
briq_panel.c
bsr.c
cd1865.h
consolemap.c
cp437.uni
cs5535_gpio.c
cyclades.c
defkeymap.c_shipped
defkeymap.map
digi1.h
digiFep1.h
digiPCI.h
ds1302.c
ds1620.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
dsp56k.c
dtlk.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
efirtc.c
epca.c
epca.h
epcaconfig.h
generic_nvram.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
generic_serial.c
genrtc.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
hangcheck-timer.c hangcheck-timer: fix x86_32 bugs 2010-05-25 08:07:02 -07:00
hpet.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
hvc_beat.c
hvc_console.c
hvc_console.h
hvc_irq.c
hvc_iseries.c
hvc_iucv.c
hvc_rtas.c
hvc_udbg.c
hvc_vio.c
hvc_xen.c
hvcs.c
hvsi.c hvsi: fix messed up error checking getting state name 2010-05-25 08:07:03 -07:00
i8k.c procfs: Push down the bkl from ioctl 2010-05-17 03:06:12 +02:00
isicom.c serial: isicomm: handle running out of slots 2010-05-21 09:34:30 -07:00
istallion.c
keyboard.c
lp.c
mbcs.c
mbcs.h
mem.c
misc.c drivers: misc: pass miscdevice pointer via file private data 2010-05-25 08:07:03 -07:00
mmtimer.c
moxa.c
moxa.h
mspec.c
mxser.c
mxser.h
n_gsm.c tty: n_gsm line discipline 2010-05-21 09:34:29 -07:00
n_hdlc.c
n_r3964.c
n_tty.c
nozomi.c
nsc_gpio.c
nvram.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
nwbutton.c
nwbutton.h
nwflash.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
pc8736x_gpio.c
ppdev.c
ps3flash.c
pty.c
random.c random: simplify fips mode 2010-05-20 19:55:01 +10:00
raw.c drivers: Push down BKL into various drivers 2010-05-17 05:27:41 +02:00
riscom8.c
riscom8.h
riscom8_reg.h
rocket.c
rocket.h
rocket_int.h
rtc.c
scc.h
scx200_gpio.c
selection.c
ser_a2232.c
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c serial: Tidy REMOTE_DEBUG 2010-05-21 09:34:31 -07:00
snsc.c
snsc.h
snsc_event.c
sonypi.c
specialix.c
specialix_io8.h
stallion.c
sx.c
sx.h
sxboards.h
sxwindow.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2010-05-20 10:33:06 -07:00
tb0219.c
tlclk.c
toshiba.c
tty_audit.c
tty_buffer.c tty: fix obsolete comment on tty_insert_flip_string_fixed_flag 2010-05-21 09:34:30 -07:00
tty_io.c tty: Fix unbalanced BKL handling in error path 2010-05-13 12:10:56 -07:00
tty_ioctl.c
tty_ldisc.c
tty_port.c
uv_mmtimer.c
vc_screen.c
viotape.c of: Always use 'struct device.of_node' to get device node pointer. 2010-05-18 16:10:44 -06:00
virtio_console.c drivers/char: Eliminate use after free 2010-05-19 22:15:51 +09:30
vme_scc.c
vt.c drivers/char/vt.c: use memdup_user 2010-05-27 09:12:40 -07:00
vt_ioctl.c