mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-01 17:52:26 +00:00
DM USB: xHCI: Fix a potential NULL pointer issue.
After excap pointer is assigned, it should be checked whether it's possible to get assignment for NULL pointer or not. This patch fixes this issue. Tracked-On: #1479 Signed-off-by: Liang Yang <liang3.yang@intel.com> Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com> Reviewed-by: Liu Shuo <shuo.a.liu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
1568a4c095
commit
84c0c87842
@ -4001,13 +4001,13 @@ pci_xhci_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
|||||||
* ended by EXCAP_GROUP_END at last item.
|
* ended by EXCAP_GROUP_END at last item.
|
||||||
*/
|
*/
|
||||||
excap = xdev->excap_ptr;
|
excap = xdev->excap_ptr;
|
||||||
xdev->excapoff = excap->start;
|
|
||||||
|
|
||||||
if (!excap) {
|
if (!excap) {
|
||||||
UPRINTF(LWRN, "Failed to set xHCI extended capability\r\n");
|
error = -1;
|
||||||
return -1;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xdev->excapoff = excap->start;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
xdev->regsend = excap->end;
|
xdev->regsend = excap->end;
|
||||||
excap++;
|
excap++;
|
||||||
|
Loading…
Reference in New Issue
Block a user