2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-27 16:15:54 +08:00

staging: lustre: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scriptcoccinelle/api/memdup.cocci.

Signed-off-by: Madhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ravindran, Madhusudhanan (M.) 2015-03-12 17:35:52 +00:00 committed by Greg Kroah-Hartman
parent 834fe2e183
commit 9cda6856e9

View File

@ -132,11 +132,10 @@ static int ll_xattr_cache_add(struct list_head *cache,
xattr->xe_namelen);
goto err_name;
}
xattr->xe_value = kzalloc(xattr_val_len, GFP_NOFS);
xattr->xe_value = kmemdup(xattr_val, xattr_val_len, GFP_NOFS);
if (!xattr->xe_value)
goto err_value;
memcpy(xattr->xe_value, xattr_val, xattr_val_len);
xattr->xe_vallen = xattr_val_len;
list_add(&xattr->xe_list, cache);