From 7199677d2e919edc75d1fb8856c98cd0c1bbcfc5 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 18 Feb 2008 13:09:03 -0800 Subject: driver-core: fix kernel-doc function parameters Fix drivers/base/ missing kernel-doc parameters: Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'drv' Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'kobj' Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'fmt' Warning(linux-2.6.24-git12//drivers/base/power/main.c:530): No description found for parameter 'state' Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman --- drivers/base/driver.c | 3 +++ drivers/base/power/main.c | 1 + 2 files changed, 4 insertions(+) (limited to 'drivers/base') diff --git a/drivers/base/driver.c b/drivers/base/driver.c index ba75184c653..bf31a0170a4 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -120,6 +120,9 @@ EXPORT_SYMBOL_GPL(driver_remove_file); /** * driver_add_kobj - add a kobject below the specified driver + * @drv: requesting device driver + * @kobj: kobject to add below this driver + * @fmt: format string that names the kobject * * You really don't want to do this, this is only here due to one looney * iseries driver, go poke those developers if you are annoyed about diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index bdc03f7e842..d6095608465 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -523,6 +523,7 @@ static void lock_all_devices(void) /** * device_suspend - Save state and stop all devices in system. + * @state: new power management state * * Prevent new devices from being registered, then lock all devices * and suspend them. -- cgit v1.2.3 From 0763446429e46fd973f507f79900b95eb8aae2e4 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Mon, 18 Feb 2008 17:04:25 +0100 Subject: Driver core: Fix error handling in bus_add_driver(). - If the allocation of ->priv fails, the reference on the bus must be dropped. - If adding the kobject fails, kobject_put must be called to clean things up. Signed-off-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman --- drivers/base/bus.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/base') diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 055989e9479..2d207ad3033 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -658,9 +658,10 @@ int bus_add_driver(struct device_driver *drv) pr_debug("bus: '%s': add driver %s\n", bus->name, drv->name); priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - + if (!priv) { + error = -ENOMEM; + goto out_put_bus; + } klist_init(&priv->klist_devices, NULL, NULL); priv->driver = drv; drv->p = priv; @@ -668,7 +669,7 @@ int bus_add_driver(struct device_driver *drv) error = kobject_init_and_add(&priv->kobj, &driver_ktype, NULL, "%s", drv->name); if (error) - goto out_put_bus; + goto out_unregister; if (drv->bus->p->drivers_autoprobe) { error = driver_attach(drv); -- cgit v1.2.3 From ec5a42465abc585a7f8117be5eecc361490e48ce Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 20 Feb 2008 02:01:41 +0100 Subject: PM: Remove unbalanced mutex_unlock() from dpm_resume() Remove an unnecessary unlocking of dpm_list_mtx in the error path in drivers/base/power/main.c:dpm_suspend() . Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/base/power/main.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index d6095608465..cea5ed3919c 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -479,7 +479,6 @@ static int dpm_suspend(pm_message_t state) mutex_lock(&dpm_list_mtx); if (list_empty(&dev->power.entry)) list_add(&dev->power.entry, &dpm_locked); - mutex_unlock(&dpm_list_mtx); break; } mutex_lock(&dpm_list_mtx); -- cgit v1.2.3