Author: np Date: Thu Feb 23 07:48:58 2017 New Revision: 314131 URL: https://svnweb.freebsd.org/changeset/base/314131
Log: Avoid NULL dereference in a couple of sysctl handlers in ibcore. iw_cxgbe sets ib_device->dma_device to NULL (since r311880). Reviewed by: hselasky@ Sponsored by: Chelsio Communications Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Feb 23 07:45:58 2017 (r314130) +++ head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Feb 23 07:48:58 2017 (r314131) @@ -1225,7 +1225,7 @@ show_dev_device(struct device *device, s { struct ib_uverbs_device *dev = dev_get_drvdata(device); - if (!dev) + if (!dev || !dev->ib_dev->dma_device) return -ENODEV; return sprintf(buf, "0x%04x\n", @@ -1238,7 +1238,7 @@ show_dev_vendor(struct device *device, s { struct ib_uverbs_device *dev = dev_get_drvdata(device); - if (!dev) + if (!dev || !dev->ib_dev->dma_device) return -ENODEV; return sprintf(buf, "0x%04x\n", _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"