kernel needs to kobject_put on dev->kobj if elv_register_queue fails.
Signed-off-by: Xiaotian Feng <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Nikanth Karthikesan <[email protected]>
Cc: David Teigland <[email protected]>
---
block/blk-sysfs.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 001ab18..0749b89 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -511,6 +511,7 @@ int blk_register_queue(struct gendisk *disk)
kobject_uevent(&q->kobj, KOBJ_REMOVE);
kobject_del(&q->kobj);
blk_trace_remove_sysfs(disk_to_dev(disk));
+ kobject_put(&dev->kobj);
return ret;
}
--
1.7.2.1
On 2010-08-13 12:44, Xiaotian Feng wrote:
> kernel needs to kobject_put on dev->kobj if elv_register_queue fails.
>
> Signed-off-by: Xiaotian Feng <[email protected]>
> Cc: Jens Axboe <[email protected]>
> Cc: "Martin K. Petersen" <[email protected]>
> Cc: Stephen Hemminger <[email protected]>
> Cc: Nikanth Karthikesan <[email protected]>
> Cc: David Teigland <[email protected]>
> ---
> block/blk-sysfs.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index 001ab18..0749b89 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -511,6 +511,7 @@ int blk_register_queue(struct gendisk *disk)
> kobject_uevent(&q->kobj, KOBJ_REMOVE);
> kobject_del(&q->kobj);
> blk_trace_remove_sysfs(disk_to_dev(disk));
> + kobject_put(&dev->kobj);
> return ret;
> }
>
Looks correct. Thanks, applied.
--
Jens Axboe