From: Hans de Goede Date: Wed, 13 Nov 2013 08:32:22 +0000 (+0100) Subject: uas: Fix memory management X-Git-Tag: v3.15-rc1~137^2~26^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21fc05b680f6fba868b41e2713ade3fdea4049f9;p=pandora-kernel.git uas: Fix memory management The scsi-host structure is refcounted, scsi_remove_host tears down the scsi-host but does not decrement the refcount, so we need to call scsi_put_host on disconnect to get the underlying memory to be freed. After calling scsi_remove_host, the scsi-core may still hold a reference to the scsi-host, iow we may still get called after uas_disconnect, but we do our own life cycle management of uas_devinfo, freeing it on disconnect, and thus may end up using devinfo after it has been freed. Switch to letting scsi_host_alloc allocate and manage the memory for us. Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- Reading git-diff-tree failed