aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtd_blkdevs.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-03 07:46:12 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2007-12-03 07:46:12 -0500
commitce37ab42ad8b38ef2f36c31c6b4c39b87f36b792 (patch)
tree6d050ed72e3044401008e8c3e3ae60adc68be4d9 /drivers/mtd/mtd_blkdevs.c
parent846fc31d06e54ad94026da11da0668c050fe777e (diff)
[MTD] Always initialise mutex in new mtd_blktrans_dev.
We were only initialising the mutex in the case where the new device was automatically allocated the highest minor number. If the caller specified a minor number, or if it filled in a free slot which was made by a previous device deregistering, the mutex wouldn't get initialised when we jumped out of the loop. Reported by Monte Copeland <catboat@texas.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r--drivers/mtd/mtd_blkdevs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 74d9d30edabd..839eed8430a2 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -248,9 +248,9 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
248 return -EBUSY; 248 return -EBUSY;
249 } 249 }
250 250
251 mutex_init(&new->lock);
252 list_add_tail(&new->list, &tr->devs); 251 list_add_tail(&new->list, &tr->devs);
253 added: 252 added:
253 mutex_init(&new->lock);
254 if (!tr->writesect) 254 if (!tr->writesect)
255 new->readonly = 1; 255 new->readonly = 1;
256 256