Commit 221e3198 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan Committed by Roland Dreier

IB/ipath: Fix memory leak if allocation fails

If the second allocation failed, the first structure allocated in this
routine was not freed.
Signed-off-by: default avatarBryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 6022943e
...@@ -1326,6 +1326,9 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd, ...@@ -1326,6 +1326,9 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd,
"for port %u rcvhdrqtailaddr failed\n", "for port %u rcvhdrqtailaddr failed\n",
pd->port_port); pd->port_port);
ret = -ENOMEM; ret = -ENOMEM;
dma_free_coherent(&dd->pcidev->dev, amt,
pd->port_rcvhdrq, pd->port_rcvhdrq_phys);
pd->port_rcvhdrq = NULL;
goto bail; goto bail;
} }
pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail; pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment