diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-06-18 18:31:44 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-06-21 22:24:55 -0700 |
commit | 1c50ef042d1310dba9d3d9429f4b67b98ae53e8e (patch) | |
tree | 4faf4da3e182f031adf8b420c18bb392f69d6b38 /lib/parser.c | |
parent | 38d10b5fd8eb81e10b9572359c90e627432217d1 (diff) |
scsi_host regression: fix scsi host leak
The patch is upstream as commit 3ed7897242b7efe977f3a8d06d4e5a4ebe28b10e
A different backport is necessary because of the class_device to device
conversion post 2.6.25.
commit 9c7701088a61cc0cf8a6e1c68d1e74e3cc2ee0b7
Author: Dave Young <hidave.darkstar@gmail.com>
Date: Tue Jan 22 14:01:34 2008 +0800
scsi: use class iteration api
Isn't a correct replacement for the original hand rolled host
lookup. The problem is that class_find_child would get a reference to
the host's class device which is never released. Since the host class
device holds a reference to the host gendev, the host can never be
freed.
In 2.6.25 we started using class_find_device, and this function also
gets a reference to the device, so we end up with an extra ref
and the host will not get released.
This patch adds a class_put_device to balance the class_find_device()
get. I kept the scsi_host_get in scsi_host_lookup, because the target
layer is using scsi_host_lookup and it looks like it needs the SHOST_DEL
check.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/parser.c')
0 files changed, 0 insertions, 0 deletions