Commit 9cda6856 authored by Ravindran, Madhusudhanan (M.)'s avatar Ravindran, Madhusudhanan (M.) Committed by Greg Kroah-Hartman

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: default avatarMadhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 834fe2e1
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment