Phonet: handle rtnetlink registration failure

Signed-off-by: RĂ©mi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index af49db0..fd41810 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -190,9 +190,13 @@
 /* Initialize Phonet devices list */
 int __init phonet_device_init(void)
 {
+	int err;
+
 	register_netdevice_notifier(&phonet_device_notifier);
-	phonet_netlink_register();
-	return 0;
+	err = phonet_netlink_register();
+	if (err)
+		phonet_device_exit();
+	return err;
 }
 
 void phonet_device_exit(void)