| Submitter | Hannes Reinecke |
|---|---|
| Date | Nov. 12, 2009, 9:54 a.m. |
| Message ID | <4AFBDB53.7020400@suse.de> |
| Download | mbox | patch |
| Permalink | /patch/38228/ |
| State | New |
| Headers | show |
Comments
Patch
diff --git a/dma-helpers.c b/dma-helpers.c index 712ed89..0c57648 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -12,7 +12,10 @@ void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint) { - qsg->sg = qemu_malloc(alloc_hint * sizeof(ScatterGatherEntry)); + if (alloc_hint > 0) + qsg->sg = qemu_malloc(alloc_hint * sizeof(ScatterGatherEntry)); + else + qsg->sg = NULL; qsg->nsg = 0; qsg->nalloc = alloc_hint; qsg->size = 0;