diff options
author | np <np@FreeBSD.org> | 2017-05-24 19:18:36 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2017-05-24 19:18:36 +0000 |
commit | 5c8aace23806c1aad3dda1fbc78c17a8984db864 (patch) | |
tree | 3b3ba15dbb2e4733a220bc3846bd2ce1366d9839 /sys/ofed/drivers/infiniband | |
parent | caee363309969d84040eb3bec7bd6523a4564187 (diff) | |
download | FreeBSD-src-5c8aace23806c1aad3dda1fbc78c17a8984db864.zip FreeBSD-src-5c8aace23806c1aad3dda1fbc78c17a8984db864.tar.gz |
MFC r314131:
Avoid NULL dereference in a couple of sysctl handlers in ibcore.
iw_cxgbe sets ib_device->dma_device to NULL (since r311880).
Sponsored by: Chelsio Communications
Diffstat (limited to 'sys/ofed/drivers/infiniband')
-rw-r--r-- | sys/ofed/drivers/infiniband/core/uverbs_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ofed/drivers/infiniband/core/uverbs_main.c b/sys/ofed/drivers/infiniband/core/uverbs_main.c index beec1c8..95e04f5 100644 --- a/sys/ofed/drivers/infiniband/core/uverbs_main.c +++ b/sys/ofed/drivers/infiniband/core/uverbs_main.c @@ -1225,7 +1225,7 @@ show_dev_device(struct device *device, struct device_attribute *attr, char *buf) { 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, struct device_attribute *attr, char *buf) { 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", |