mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-10 20:43:48 +00:00
ACRN: DM: Fix the vsock Guest Cid overflow issue
The vsock cid type is u64, redefine the cid type to u64, and use dm_strtoul API replace dm_strtoi. Tracked-On: #7456 Signed-off-by: Liu Long <long.liu@linux.intel.com>
This commit is contained in:
parent
9ec81eb9e6
commit
32af0abe0a
@ -238,7 +238,8 @@ static int
|
|||||||
virtio_vhost_vsock_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
virtio_vhost_vsock_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
||||||
{
|
{
|
||||||
struct virtio_vsock *vsock;
|
struct virtio_vsock *vsock;
|
||||||
int rc, cid;
|
int rc;
|
||||||
|
uint64_t cid;
|
||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
char *devopts = NULL;
|
char *devopts = NULL;
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
@ -254,7 +255,7 @@ virtio_vhost_vsock_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
|||||||
}
|
}
|
||||||
if (!strncmp(tmp, "cid=", 4)) {
|
if (!strncmp(tmp, "cid=", 4)) {
|
||||||
strsep(&tmp, "=");
|
strsep(&tmp, "=");
|
||||||
dm_strtoi(tmp, NULL, 10, &cid);
|
dm_strtoul(tmp, NULL, 10, &cid);
|
||||||
}
|
}
|
||||||
free(devopts);
|
free(devopts);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user