未验证 提交 4a152517 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!138 vfio-pci: Mask cap zero

Merge Pull Request from: @babyihc 
 
This PR is cherry-pick from upstream "vfio-pci: Mask cap zero"

Upstream patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc138db1b96264b9c1779cf18d5a3b186aa90066
 
 
Link:https://gitee.com/openeuler/kernel/pulls/138 
Reviewed-by: Laibin Qiu <qiulaibin@huawei.com> 
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com> 
...@@ -1494,7 +1494,12 @@ static int vfio_cap_init(struct vfio_pci_device *vdev) ...@@ -1494,7 +1494,12 @@ static int vfio_cap_init(struct vfio_pci_device *vdev)
if (ret) if (ret)
return ret; return ret;
if (cap <= PCI_CAP_ID_MAX) { /*
* ID 0 is a NULL capability, conflicting with our fake
* PCI_CAP_ID_BASIC. As it has no content, consider it
* hidden for now.
*/
if (cap && cap <= PCI_CAP_ID_MAX) {
len = pci_cap_length[cap]; len = pci_cap_length[cap];
if (len == 0xFF) { /* Variable length */ if (len == 0xFF) { /* Variable length */
len = vfio_cap_len(vdev, cap, pos); len = vfio_cap_len(vdev, cap, pos);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册