From e32c9e6300e3af659cbfe45e90a1e7dcd3572ada Mon Sep 17 00:00:00 2001 From: Vaughan Cao Date: Thu, 29 Aug 2013 10:00:38 +0800 Subject: [PATCH] [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-format-patch failed