diff options
author | Tymoteusz Kielan <tymoteusz.kielan@intel.com> | 2016-07-25 22:38:01 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-08-02 22:00:58 +0200 |
commit | 1b23f02cf4bbe644028077539b1045f742d61fa2 (patch) | |
tree | 98ee56a58da6cc05372905bd9520aca40ac99d1a | |
parent | IB/hfi1: Fix integrity errors counter value calculation (diff) | |
download | linux-1b23f02cf4bbe644028077539b1045f742d61fa2.tar.xz linux-1b23f02cf4bbe644028077539b1045f742d61fa2.zip |
IB/hfi1: Fix to fully initialize send context area
While handling buffer control MAD, partially initialized
dd->kernel_send_context area may cause potential dereference
of uninitialized pointers. Fix by using kzalloc_node()
instead of kmalloc_node().
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Andrzej Kacprowski <andrzej.kacprowski@intel.com>
Signed-off-by: Tymoteusz Kielan <tymoteusz.kielan@intel.com>
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/hfi1/pio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c index d4022450b73f..a99fccadf624 100644 --- a/drivers/infiniband/hw/hfi1/pio.c +++ b/drivers/infiniband/hw/hfi1/pio.c @@ -1956,7 +1956,7 @@ int init_pervl_scs(struct hfi1_devdata *dd) hfi1_init_ctxt(dd->vld[15].sc); dd->vld[15].mtu = enum_to_mtu(OPA_MTU_2048); - dd->kernel_send_context = kmalloc_node(dd->num_send_contexts * + dd->kernel_send_context = kzalloc_node(dd->num_send_contexts * sizeof(struct send_context *), GFP_KERNEL, dd->node); dd->kernel_send_context[0] = dd->vld[15].sc; |