浏览代码

Merge branch 'topic/core' into for-linus

Vinod Koul 9 年之前
父节点
当前提交
99823374d3
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      drivers/dma/dmaengine.c

+ 7 - 0
drivers/dma/dmaengine.c

@@ -997,6 +997,13 @@ int dma_async_device_register(struct dma_device *device)
 		}
 		chan->client_count = 0;
 	}
+
+	if (!chancnt) {
+		dev_err(device->dev, "%s: device has no channels!\n", __func__);
+		rc = -ENODEV;
+		goto err_out;
+	}
+
 	device->chancnt = chancnt;
 
 	mutex_lock(&dma_list_mutex);