svn commit: r318801 - stable/11/sys/ofed/drivers/infiniband/core

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


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


More information about the svn-src-all mailing list