Skip to content

Commit 3b0889f

Browse files
tititiou36gregkh
authored andcommitted
rpmb: Remove some useless locking
There is no need for explicit locking when using the ida API, as stated in the doc related to ida_alloc_range() / ida_free(). So remove rpmb_mutex. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/b1fcc6707ec2b6309d50060fa52ccc2c892afde2.1728507153.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dfc881a commit 3b0889f

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/misc/rpmb-core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <linux/slab.h>
1414

1515
static DEFINE_IDA(rpmb_ida);
16-
static DEFINE_MUTEX(rpmb_mutex);
1716

1817
/**
1918
* rpmb_dev_get() - increase rpmb device ref counter
@@ -63,9 +62,7 @@ static void rpmb_dev_release(struct device *dev)
6362
{
6463
struct rpmb_dev *rdev = to_rpmb_dev(dev);
6564

66-
mutex_lock(&rpmb_mutex);
6765
ida_free(&rpmb_ida, rdev->id);
68-
mutex_unlock(&rpmb_mutex);
6966
kfree(rdev->descr.dev_id);
7067
kfree(rdev);
7168
}
@@ -175,9 +172,7 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev,
175172
goto err_free_rdev;
176173
}
177174

178-
mutex_lock(&rpmb_mutex);
179175
ret = ida_alloc(&rpmb_ida, GFP_KERNEL);
180-
mutex_unlock(&rpmb_mutex);
181176
if (ret < 0)
182177
goto err_free_dev_id;
183178
rdev->id = ret;

0 commit comments

Comments
 (0)