projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4facbe3
)
net: eql: Use kzalloc instead of kmalloc/memset
author
Haowen Bai
<baihaowen@meizu.com>
Mon, 18 Apr 2022 10:22:13 +0000
(18:22 +0800)
committer
Paolo Abeni
<pabeni@redhat.com>
Thu, 21 Apr 2022 12:40:21 +0000
(14:40 +0200)
Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link:
https://lore.kernel.org/r/1650277333-31090-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/eql.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/eql.c
b/drivers/net/eql.c
index 1111d1f33865edc7f98e7057118c9e4b8c8d327b..557ca8ff9dec20d6ae69e0f7830874c5a66363b4 100644
(file)
--- 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 = k
m
alloc(sizeof(*s), GFP_KERNEL);
+ slave_t *s = k
z
alloc(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;