From: Andy Whitcroft Date: Sun, 6 May 2007 21:49:33 +0000 (-0700) Subject: tty_register_driver: only allocate tty instances when defined X-Git-Tag: v2.6.22-rc1~969 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=543691a6cd70b606dd9bed5e77b120c5d9c5c506;p=pandora-kernel.git tty_register_driver: only allocate tty instances when defined If device->num is zero we attempt to kmalloc() zero bytes. When SLUB is enabled this returns a null pointer and take that as an allocation failure and fail the device register. Check for no devices and avoid the allocation. [akpm: opportunistic kzalloc() conversion] Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed