diff options
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r-- | block/blk-sysfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index bc28776ba76a..54d0db116153 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
@@ -207,12 +207,13 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr, | |||
207 | const char *page, size_t length) | 207 | const char *page, size_t length) |
208 | { | 208 | { |
209 | struct queue_sysfs_entry *entry = to_queue(attr); | 209 | struct queue_sysfs_entry *entry = to_queue(attr); |
210 | struct request_queue *q = container_of(kobj, struct request_queue, kobj); | 210 | struct request_queue *q; |
211 | |||
212 | ssize_t res; | 211 | ssize_t res; |
213 | 212 | ||
214 | if (!entry->store) | 213 | if (!entry->store) |
215 | return -EIO; | 214 | return -EIO; |
215 | |||
216 | q = container_of(kobj, struct request_queue, kobj); | ||
216 | mutex_lock(&q->sysfs_lock); | 217 | mutex_lock(&q->sysfs_lock); |
217 | if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) { | 218 | if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) { |
218 | mutex_unlock(&q->sysfs_lock); | 219 | mutex_unlock(&q->sysfs_lock); |