]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/base/bus.c
Merge branch 'next-s3c' of git://aeryn.fluff.org.uk/bjdooks/linux into devel
[mv-sheeva.git] / drivers / base / bus.c
index dc030f1f00f19706a4c5e5d0a077a085b0885187..4b04a15146d7cf3dcb0f4aec9973a5683c73cf83 100644 (file)
@@ -279,7 +279,7 @@ static struct device *next_device(struct klist_iter *i)
  *
  * NOTE: The device that returns a non-zero value is not retained
  * in any way, nor is its refcount incremented. If the caller needs
- * to retain this data, it should do, and increment the reference
+ * to retain this data, it should do so, and increment the reference
  * count in the supplied callback.
  */
 int bus_for_each_dev(struct bus_type *bus, struct device *start,
@@ -700,8 +700,10 @@ int bus_add_driver(struct device_driver *drv)
        }
 
        kobject_uevent(&priv->kobj, KOBJ_ADD);
-       return error;
+       return 0;
 out_unregister:
+       kfree(drv->p);
+       drv->p = NULL;
        kobject_put(&priv->kobj);
 out_put_bus:
        bus_put(bus);