aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/eql.c
diff options
context:
space:
mode:
authorHaowen Bai <[email protected]>2022-04-18 10:22:13 +0000
committerPaolo Abeni <[email protected]>2022-04-21 12:40:21 +0000
commit9c8774e629a1950c24b44e3c8fb93d76fb644b49 (patch)
tree81bc28c1275e352b7963e6f81267526a1a11e543 /drivers/net/eql.c
parentdrivers: net: davinci_mdio: using pm_runtime_resume_and_get instead of pm_run... (diff)
downloadkernel-9c8774e629a1950c24b44e3c8fb93d76fb644b49.tar.gz
kernel-9c8774e629a1950c24b44e3c8fb93d76fb644b49.zip
net: eql: Use kzalloc instead of kmalloc/memset
Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/net/eql.c')
-rw-r--r--drivers/net/eql.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index 1111d1f33865..557ca8ff9dec 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -425,14 +425,13 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user *
if ((master_dev->flags & IFF_UP) == IFF_UP) {
/* slave is not a master & not already a slave: */
if (!eql_is_master(slave_dev) && !eql_is_slave(slave_dev)) {
- slave_t *s = kmalloc(sizeof(*s), GFP_KERNEL);
+ slave_t *s = kzalloc(sizeof(*s), GFP_KERNEL);
equalizer_t *eql = netdev_priv(master_dev);
int ret;
if (!s)
return -ENOMEM;
- memset(s, 0, sizeof(*s));
s->dev = slave_dev;
s->priority = srq.priority;
s->priority_bps = srq.priority;