mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mmc_test: initialize mmc_test_lock statically
The mutex mmc_test_lock is initialized at every time mmc_test device is probed. Probing another mmc_test device may break the mutex, if the probe function is called while the mutex is locked. This patch fixes it by statically initializing mmc_test_lock. Signed-off-by: Akinobu Mita <[email protected]> Signed-off-by: Pierre Ossman <[email protected]>
This commit is contained in:
parent
9d4e98e960
commit
a650031a6b
1 changed files with 1 additions and 3 deletions
|
|
@ -1040,7 +1040,7 @@ static const struct mmc_test_case mmc_test_cases[] = {
|
|||
|
||||
};
|
||||
|
||||
static struct mutex mmc_test_lock;
|
||||
static DEFINE_MUTEX(mmc_test_lock);
|
||||
|
||||
static void mmc_test_run(struct mmc_test_card *test, int testcase)
|
||||
{
|
||||
|
|
@ -1171,8 +1171,6 @@ static int mmc_test_probe(struct mmc_card *card)
|
|||
if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD))
|
||||
return -ENODEV;
|
||||
|
||||
mutex_init(&mmc_test_lock);
|
||||
|
||||
ret = device_create_file(&card->dev, &dev_attr_test);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue