]> git.baikalelectronics.ru Git - kernel.git/commit
[netdrvr] depca: handle platform_device_add() failure
authorAndrea Righi <a.righi@cineca.it>
Tue, 24 Apr 2007 16:40:57 +0000 (12:40 -0400)
committerJeff Garzik <jeff@garzik.org>
Tue, 24 Apr 2007 16:40:57 +0000 (12:40 -0400)
commita9ee03ff5dd0b4819476a0df5452fe1bbb9bddec
tree5ea1c77374e894b6218b764324fe1200290a4c40
parenta31f0d019c200ea45fb2c8bad06b3bfab856e5f4
[netdrvr] depca: handle platform_device_add() failure

The following patch fixes a kernel bug in depca_platform_probe().

We don't use a dynamic pointer for pldev->dev.platform_data, so it seems
that the correct way to proceed if platform_device_add(pldev) fails is
to explicitly set the pldev->dev.platform_data pointer to NULL, before
calling the platform_device_put(pldev), or it will be kfree'ed by
platform_device_release().

Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/depca.c