If the second vmalloc() fails, the wrong pointer is pased to vfree(), so
the first vmalloc() ends up getting leaked.
This was spotted by the Coverity checker (CID 2709).
Signed-off-by: Roland Dreier <rolandd@cisco.com>
if (!addrs) {
ipath_dev_err(dd, "failed to allocate shadow dma handle "
"array, no expected sends!\n");
if (!addrs) {
ipath_dev_err(dd, "failed to allocate shadow dma handle "
"array, no expected sends!\n");
- vfree(dd->ipath_pageshadow);
dd->ipath_pageshadow = NULL;
return;
}
dd->ipath_pageshadow = NULL;
return;
}