Commit 72d62c4e authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

net: drop_monitor: Use kstrdup

Convert the equivalent but rather odd uses of kmemdup with
__GFP_ZERO to the more common kstrdup and avoid unnecessary
zeroing of copied over memory.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0208bf4
...@@ -802,16 +802,12 @@ net_dm_hw_metadata_clone(const struct net_dm_hw_metadata *hw_metadata) ...@@ -802,16 +802,12 @@ net_dm_hw_metadata_clone(const struct net_dm_hw_metadata *hw_metadata)
if (!n_hw_metadata) if (!n_hw_metadata)
return NULL; return NULL;
trap_group_name = kmemdup(hw_metadata->trap_group_name, trap_group_name = kstrdup(hw_metadata->trap_group_name, GFP_ATOMIC);
strlen(hw_metadata->trap_group_name) + 1,
GFP_ATOMIC | __GFP_ZERO);
if (!trap_group_name) if (!trap_group_name)
goto free_hw_metadata; goto free_hw_metadata;
n_hw_metadata->trap_group_name = trap_group_name; n_hw_metadata->trap_group_name = trap_group_name;
trap_name = kmemdup(hw_metadata->trap_name, trap_name = kstrdup(hw_metadata->trap_name, GFP_ATOMIC);
strlen(hw_metadata->trap_name) + 1,
GFP_ATOMIC | __GFP_ZERO);
if (!trap_name) if (!trap_name)
goto free_trap_group; goto free_trap_group;
n_hw_metadata->trap_name = trap_name; n_hw_metadata->trap_name = trap_name;
......
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