diff options
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_mrmw.c')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index cfb362a1029c..d22ab563633f 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
@@ -53,9 +53,8 @@ static struct ehca_mr *ehca_mr_new(void) | |||
53 | { | 53 | { |
54 | struct ehca_mr *me; | 54 | struct ehca_mr *me; |
55 | 55 | ||
56 | me = kmem_cache_alloc(mr_cache, GFP_KERNEL); | 56 | me = kmem_cache_zalloc(mr_cache, GFP_KERNEL); |
57 | if (me) { | 57 | if (me) { |
58 | memset(me, 0, sizeof(struct ehca_mr)); | ||
59 | spin_lock_init(&me->mrlock); | 58 | spin_lock_init(&me->mrlock); |
60 | } else | 59 | } else |
61 | ehca_gen_err("alloc failed"); | 60 | ehca_gen_err("alloc failed"); |
@@ -72,9 +71,8 @@ static struct ehca_mw *ehca_mw_new(void) | |||
72 | { | 71 | { |
73 | struct ehca_mw *me; | 72 | struct ehca_mw *me; |
74 | 73 | ||
75 | me = kmem_cache_alloc(mw_cache, GFP_KERNEL); | 74 | me = kmem_cache_zalloc(mw_cache, GFP_KERNEL); |
76 | if (me) { | 75 | if (me) { |
77 | memset(me, 0, sizeof(struct ehca_mw)); | ||
78 | spin_lock_init(&me->mwlock); | 76 | spin_lock_init(&me->mwlock); |
79 | } else | 77 | } else |
80 | ehca_gen_err("alloc failed"); | 78 | ehca_gen_err("alloc failed"); |