Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1544097
| From | "Mintz, Yuval" <Yuval.Mintz@cavium.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH] qed: fix memory leak of a qed_spq_entry on error failure paths |
| Date | 2016-12-18 07:50 +0100 |
| Message-ID | <sPDsd-451-3@gated-at.bofh.it> (permalink) |
| References | <sP0hc-3GN-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> 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 kfree'ing it and also > setting *pp_ent to NULL to be safe. > > Found with static analysis by CoverityScan, CIDs 1389468-1389470 > > Signed-off-by: Colin Ian King <colin.king@canonical.com> ... > +err: > + kfree(*pp_ent); > + *pp_ent = NULL; > + > + return rc; > } Hi Colin - thanks for this. It would have been preferable to return the previously allocated spq entry. I.e., do: +err: + qed_spq_return_entry(p_hwfn, *pp_ent); + *pp_ent = NULL; + return rc; Thanks, Yuval
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] qed: fix memory leak of a qed_spq_entry on error failure paths Colin King <colin.king@canonical.com> - 2016-12-16 14:00 +0100
RE: [PATCH] qed: fix memory leak of a qed_spq_entry on error failure paths "Mintz, Yuval" <Yuval.Mintz@cavium.com> - 2016-12-18 07:50 +0100
Re: [PATCH] qed: fix memory leak of a qed_spq_entry on error failure paths David Miller <davem@davemloft.net> - 2016-12-18 16:40 +0100
csiph-web