Commit 45cd2cfe authored by Patrick Mochel's avatar Patrick Mochel

bus drivers: fix leaking refcounts.

In drivers/base/bus.c, get_bus() was called without put_bus() in these 
functions:

- bus_for_each_dev()
- bus_for_each_drv()
parent 6fec6161
...@@ -175,6 +175,7 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start, ...@@ -175,6 +175,7 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start,
break; break;
} }
up_read(&bus->subsys.rwsem); up_read(&bus->subsys.rwsem);
put_bus(bus);
return error; return error;
} }
...@@ -218,6 +219,7 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, ...@@ -218,6 +219,7 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
break; break;
} }
up_read(&bus->subsys.rwsem); up_read(&bus->subsys.rwsem);
put_bus(bus);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment