From: David Herrmann Date: Sat, 8 Oct 2011 12:58:47 +0000 (+0200) Subject: Bluetooth: Fix hci core device initialization X-Git-Tag: v3.3-rc1~182^2~545^2~134^2~69 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ac7e7002c4d0841197e9ccb8cfecc5b8c58b200;p=pandora-kernel.git Bluetooth: Fix hci core device initialization We must not call device_del() if we didn't use device_add(). See module.c for comments on that. Therefore, we need to call device_initialize() when allocating the hci device and later device_add() instead of device_register(). This also fixes a bug when hci_register_dev() failed and we call hci_free_dev() without a valid core device. hci_free_dev() segfaults while calling put_device() on invalid memory. We already do this with hci_conn connections (hci_conn_init_sysfs()) so they do not need to be fixed. Signed-off-by: David Herrmann Signed-off-by: Gustavo F. Padovan --- Reading git-diff-tree failed