From: Paul Moore Date: Wed, 6 Aug 2025 21:17:07 +0000 (-0400) Subject: lsm: use lsm_blob_alloc() in lsm_bdev_alloc() X-Git-Tag: v6.18-rc1~201^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5bc887413e513a2cb658370dd09fa9e1702fb3b;p=thirdparty%2Flinux.git 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 Acked-by: Serge Hallyn Signed-off-by: Paul Moore --- diff --git a/security/security.c b/security/security.c index ad163f06bf7ab..a88ebfca32242 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); } /**