aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2009-12-10 08:23:57 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-12-10 08:33:53 -0500
commitcaf0e8e028516253afce6e40c52f0c193a221f8a (patch)
treea3cb81d5c9315bf0a028be6e257af2de1eb28d14 /drivers/mtd
parent51eeb878155cdea73e7a1f0372b266018bd7a424 (diff)
mtd: cfi_cmdset_0002, fix lock imbalance
Stanse found a double unlock in get_chip. get_chip is called with chip->mutex held and caller is responsible for unlocking it too. Do not unlock the lock in get_chip on a fail path. This would mean a double unlock. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 1d49e18adbf6..f3600e8d5382 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -569,7 +569,6 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
569 569
570 if (time_after(jiffies, timeo)) { 570 if (time_after(jiffies, timeo)) {
571 printk(KERN_ERR "Waiting for chip to be ready timed out.\n"); 571 printk(KERN_ERR "Waiting for chip to be ready timed out.\n");
572 spin_unlock(chip->mutex);
573 return -EIO; 572 return -EIO;
574 } 573 }
575 spin_unlock(chip->mutex); 574 spin_unlock(chip->mutex);