Re: [PATCH for-next v2 06/16] IB/hfi1: Fix for potential refcount leak in hfi1_open_file()

Jason Gunthorpe
2018-01-26T22:33:48Z

On Fri, Jan 26, 2018 at 01:29:36PM -0800, Dennis Dalessandro wrote:
> From: Alex Estrin <alex.estrin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> The dd refcount is speculatively incremented prior to allocating
> the fd memory with kzalloc(). If that kzalloc() failed the dd
> refcount leaks.
> Increment refcount on kzalloc success.
>
> Fixes: e11ffbd57520 ("IB/hfi1: Do not free hfi1 cdev parent structure early")
> Reviewed-by: Michael J Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Alex Estrin <alex.estrin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Change-Id: I660296d5860205722b3db3d0c8b0746fd8f655ab

*blark* Change-Id *blark*

Jason