serial: fix NULL pointer dereference
authorAndré Goddard Rosa <andre.goddard@gmail.com>
Sun, 25 Oct 2009 13:16:32 +0000 (11:16 -0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 23:18:04 +0000 (15:18 -0800)
commit9e845abfc8a8973373821aa05302794fd254514b
tree0dbd44e16a4fbe9554d25b4dcbc17fea7207a933
parent2a0785ea375fe93cd480599bb40d0c837ff72a2e
serial: fix NULL pointer dereference

If kzalloc() or alloc_tty_driver() fails, we call:
    put_tty_driver(normal = NULL).

Then:
    put_tty_driver -> tty_driver_kref_put -> kref_put(&NULL->kref, ...)

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/serial/serial_core.c