mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	block: fix improper kobject release in blk_integrity_unregister
blk_integrity_unregister should use kobject_put to release the kobject, otherwise after bi is freed, memory of bi->kobj->name is leaked. Signed-off-by: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
		
							parent
							
								
									a4e7d46407
								
							
						
					
					
						commit
						3839e4b29b
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -379,6 +379,7 @@ void blk_integrity_unregister(struct gendisk *disk)
 | 
			
		|||
 | 
			
		||||
	kobject_uevent(&bi->kobj, KOBJ_REMOVE);
 | 
			
		||||
	kobject_del(&bi->kobj);
 | 
			
		||||
	kobject_put(&bi->kobj);
 | 
			
		||||
	kmem_cache_free(integrity_cachep, bi);
 | 
			
		||||
	disk->integrity = NULL;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue