From 667de9e824ae559dfb8e67f7cbe5be3ce807c4ad Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <greg@kroah.com>
Date: Thu, 18 Mar 2004 22:15:17 -0800
Subject: [PATCH] Driver class: remove possible oops

This happens when the device associated with a class device goes away before
the class does.
---
 drivers/base/class.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index f6a96e931788..b9fdce488e2c 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -155,8 +155,7 @@ static int class_device_dev_link(struct class_device * class_dev)
 
 static void class_device_dev_unlink(struct class_device * class_dev)
 {
-	if (class_dev->dev)
-		sysfs_remove_link(&class_dev->kobj, "device");
+	sysfs_remove_link(&class_dev->kobj, "device");
 }
 
 static int class_device_driver_link(struct class_device * class_dev)
@@ -169,8 +168,7 @@ static int class_device_driver_link(struct class_device * class_dev)
 
 static void class_device_driver_unlink(struct class_device * class_dev)
 {
-	if ((class_dev->dev) && (class_dev->dev->driver))
-		sysfs_remove_link(&class_dev->kobj, "driver");
+	sysfs_remove_link(&class_dev->kobj, "driver");
 }
 
 
-- 
2.30.9