mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-23 21:51:27 +00:00
ib_srpt: Made sure that accessing sysfs entries during target creation is harmless.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2703 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2140,6 +2140,9 @@ static int srpt_enable_target(struct scst_tgt *scst_tgt, bool enable)
|
||||
|
||||
EXTRACHECKS_WARN_ON_ONCE(irqs_disabled());
|
||||
|
||||
if (!sdev)
|
||||
return -ENOENT;
|
||||
|
||||
TRACE_DBG("%s target %s", enable ? "Enabling" : "Disabling",
|
||||
sdev->device->name);
|
||||
|
||||
@@ -2160,6 +2163,9 @@ static bool srpt_is_target_enabled(struct scst_tgt *scst_tgt)
|
||||
|
||||
EXTRACHECKS_WARN_ON_ONCE(irqs_disabled());
|
||||
|
||||
if (!sdev)
|
||||
return false;
|
||||
|
||||
spin_lock_irq(&sdev->spinlock);
|
||||
res = sdev->enabled;
|
||||
spin_unlock_irq(&sdev->spinlock);
|
||||
|
||||
Reference in New Issue
Block a user