svn commit: r318802 - stable/10/sys/ofed/drivers/infiniband/core

Navdeep Parhar np at FreeBSD.org
Wed May 24 19:19:03 UTC 2017


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",


More information about the svn-src-stable mailing list