Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1545784
| From | Colin Ian King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH][V2] qed: fix memory leak of a qed_spq_entry on error failure paths |
| Date | 2016-12-21 15:30 +0100 |
| Message-ID | <sQQ41-4zv-17@gated-at.bofh.it> (permalink) |
| References | <sQr5D-52P-17@gated-at.bofh.it> <sQQ41-4zv-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 21/12/16 13:29, Mintz, Yuval wrote: >> From: Colin Ian King <colin.king@canonical.com> >> >> A qed_spq_entry entry is allocated by qed_sp_init_request but is not kfree'd >> if an error occurs, causing a memory leak. Fix this by returning the previously >> allocated spq entry and also setting *pp_ent to NULL to be safe. >> >> Thanks to Yuval Mintz for suggestions on how to improve my original fix. >> >> Signed-off-by: Colin Ian King <colin.king@canonical.com> > > We've given it a more thorough look, and apparently this isn't the correct fix. > So I'll start by saying sorry for making you send this V2 needlessly. > > It boils down to the fact there are two kinds of SPQ entries - > Those originating from the 'free_pool' and those from the 'unlimited_pending'. > Only those originating from the free_pool should be returned > using the qed_spq_return_entry(), as only those actually point to a valid > dma-mapped memory where FW expects to find the entries; > Returning the other kind would lead to assertions later, > as driver would post a ramrod to FW which actually points to address 0. > > Looking at the error flows, it seems possible this isn't the only faulty > error flow in the SPQ. I suggest you'd drop this and we'll take it from > here [although if you really have the urge to continue - please do]. > > Thanks, > Yuval > > Sure, lets drop my fixes, I'm out of time on this for 2016 anyhow. Colin
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH][V2] qed: fix memory leak of a qed_spq_entry on error failure paths Colin King <colin.king@canonical.com> - 2016-12-20 12:50 +0100 Re: [PATCH][V2] qed: fix memory leak of a qed_spq_entry on error failure paths Colin Ian King <colin.king@canonical.com> - 2016-12-21 15:30 +0100 RE: [PATCH][V2] qed: fix memory leak of a qed_spq_entry on error failure paths "Mintz, Yuval" <Yuval.Mintz@cavium.com> - 2016-12-21 16:10 +0100
csiph-web