Date: Wed, 24 May 2017 19:19:02 +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-10@freebsd.org Subject: svn commit: r318802 - stable/10/sys/ofed/drivers/infiniband/core Message-ID: <201705241919.v4OJJ2Md072720@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Wed May 24 19:19:02 2017 New Revision: 318802 URL: https://svnweb.freebsd.org/changeset/base/318802 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/10/sys/ofed/drivers/infiniband/core/uverbs_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c Wed May 24 19:18:36 2017 (r318801) +++ stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c Wed May 24 19:19:02 2017 (r318802) @@ -782,7 +782,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", @@ -795,7 +795,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?201705241919.v4OJJ2Md072720>