Date: Wed, 24 May 2017 19:18:36 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r318801 - stable/11/sys/ofed/drivers/infiniband/core Message-ID: <201705241918.v4OJIaB7072655@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Wed May 24 19:18:36 2017 New Revision: 318801 URL: https://svnweb.freebsd.org/changeset/base/318801 Log: 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 Modified: stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c Wed May 24 18:54:21 2017 (r318800) +++ stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c Wed May 24 19:18:36 2017 (r318801) @@ -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",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705241918.v4OJIaB7072655>