Skip to contentSkip to conversation

mthca - check for NULL mode in uverbs_devnode()

PATCH Goldwyn Rodrigues 1 participant 1 message Jul 2, 2011 InfiniBand

lore
Share & tools
lore
#0 lore raw

Unloading ib_mthca crashes with a NULL pointer dereference because devtmpfs_delete_node() calls device_get_devnode() with mode as NULL.

---

drivers/infiniband/core/uverbs_main.c +2 -1
index e49a85f..56898b6 100644
@@ -826,7 +826,8 @@ static void ib_uverbs_remove_one(struct ib_device *device)
 
 static char *uverbs_devnode(struct device *dev, mode_t *mode)
 {
-	*mode = 0666;
+	if (mode)
+		*mode = 0666;
 	return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
 }
 
Signature · 5 lines
Goldwyn
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html