From: Vaughan Cao Date: Thu, 29 Aug 2013 02:00:38 +0000 (+0800) Subject: [SCSI] sg: checking sdp->detached isn't protected when open X-Git-Tag: v3.12-rc1~180^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e32c9e6300e3af659cbfe45e90a1e7dcd3572ada;p=pandora-kernel.git [SCSI] sg: checking sdp->detached isn't protected when open @detached is set under the protection of sg_index_lock. Without getting the lock, new sfp will be added during sg removal and there is no chance for it to be picked out. So check with sg_index_lock held in sg_add_sfp(). Signed-off-by: Vaughan Cao Acked-by: Douglas Gilbert Signed-off-by: James Bottomley --- Reading git-diff-tree failed