aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2025-08-06 17:17:07 -0400
committerPaul Moore <paul@paul-moore.com>2025-08-11 17:56:08 -0400
commite5bc887413e513a2cb658370dd09fa9e1702fb3b (patch)
tree2b75e0f8741888d837d5e6e94235b1ed7dd83415 /security/security.c
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585 (diff)
downloadlinux-e5bc887413e513a2cb658370dd09fa9e1702fb3b.tar.gz
lsm: use lsm_blob_alloc() in lsm_bdev_alloc()
Convert the lsm_bdev_alloc() function to use the lsm_blob_alloc() helper like all of the other LSM security blob allocators. Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/security/security.c b/security/security.c
index ad163f06bf7abc..a88ebfca322420 100644
--- a/security/security.c
+++ b/security/security.c
@@ -823,16 +823,8 @@ static int lsm_msg_msg_alloc(struct msg_msg *mp)
*/
static int lsm_bdev_alloc(struct block_device *bdev)
{
- if (blob_sizes.lbs_bdev == 0) {
- bdev->bd_security = NULL;
- return 0;
- }
-
- bdev->bd_security = kzalloc(blob_sizes.lbs_bdev, GFP_KERNEL);
- if (!bdev->bd_security)
- return -ENOMEM;
-
- return 0;
+ return lsm_blob_alloc(&bdev->bd_security, blob_sizes.lbs_bdev,
+ GFP_KERNEL);
}
/**