Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+2 -10
+2 -10
security/security.c
··· 823 823 */ 824 824 static int lsm_bdev_alloc(struct block_device *bdev) 825 825 { 826 - if (blob_sizes.lbs_bdev == 0) { 827 - bdev->bd_security = NULL; 828 - return 0; 829 - } 830 - 831 - bdev->bd_security = kzalloc(blob_sizes.lbs_bdev, GFP_KERNEL); 832 - if (!bdev->bd_security) 833 - return -ENOMEM; 834 - 835 - return 0; 826 + return lsm_blob_alloc(&bdev->bd_security, blob_sizes.lbs_bdev, 827 + GFP_KERNEL); 836 828 } 837 829 838 830 /**