Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;