]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] fix /proc memory leak in the SCSI core
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 27 Feb 2009 21:51:42 +0000 (16:51 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 12 Mar 2009 17:58:17 +0000 (12:58 -0500)
commit1f857a84ea63a8b88d540ed44e1d8ac6b6ff9e8b
tree7a8a5382a3be5c2662dcab8e726a3dcc94d6d924
parent7cb8e72a3df70809a75b308fe96767486bfc1000
[SCSI] fix /proc memory leak in the SCSI core

The SCSI core calls scsi_proc_hostdir_add() from within
scsi_host_alloc(), but the corresponding scsi_proc_hostdir_rm()
routine is called from within scsi_remove_host().  As a result, if a
host is allocated and then deallocated without ever being registered,
the host's directory in /proc is leaked.

This patch (as1181b) fixes this bug in the SCSI core by moving
scsi_proc_hostdir_rm() into scsi_host_dev_release().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/hosts.c