IB/hfi1: Check for error on call to alloc_rsm_map_table
authorJohn Fleck <john.fleck@intel.com>
Mon, 15 Jul 2019 16:45:21 +0000 (12:45 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 22 Jul 2019 17:57:54 +0000 (14:57 -0300)
commitcd48a82087231fdba0e77521102386c6ed0168d6
tree74c331076ed746342cd4d60a47e73f12be2ede47
parent60c3becfd1a138fdcfe48f2a5ef41ef0078d481e
IB/hfi1: Check for error on call to alloc_rsm_map_table

The call to alloc_rsm_map_table does not check if the kmalloc fails.
Check for a NULL on alloc, and bail if it fails.

Fixes: 372cc85a13c9 ("IB/hfi1: Extract RSM map table init from QOS")
Link: https://lore.kernel.org/r/20190715164521.74174.27047.stgit@awfm-01.aw.intel.com
Cc: <stable@vger.kernel.org>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: John Fleck <john.fleck@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/chip.c