Commit 1b23f02c authored by Tymoteusz Kielan's avatar Tymoteusz Kielan Committed by Doug Ledford

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: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarAndrzej Kacprowski <andrzej.kacprowski@intel.com>
Signed-off-by: default avatarTymoteusz Kielan <tymoteusz.kielan@intel.com>
Signed-off-by: default avatarAndrzej Kacprowski <andrzej.kacprowski@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 3210314a
...@@ -1956,7 +1956,7 @@ int init_pervl_scs(struct hfi1_devdata *dd) ...@@ -1956,7 +1956,7 @@ int init_pervl_scs(struct hfi1_devdata *dd)
hfi1_init_ctxt(dd->vld[15].sc); hfi1_init_ctxt(dd->vld[15].sc);
dd->vld[15].mtu = enum_to_mtu(OPA_MTU_2048); 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 *), sizeof(struct send_context *),
GFP_KERNEL, dd->node); GFP_KERNEL, dd->node);
dd->kernel_send_context[0] = dd->vld[15].sc; dd->kernel_send_context[0] = dd->vld[15].sc;
......
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